Skip to main content
POST
cURL
POST https://api.pre.dev/v1/messages accepts the Anthropic Messages request body and returns the Anthropic response. Use it with the Anthropic SDK: set the client’s baseURL to https://api.pre.dev, without /v1, because the SDK appends /v1/messages itself. Pass the pre.dev key as the API key; the SDK’s x-api-key header is accepted. Model ids are the catalog ids exactly as listed by GET /v1/models, so anthropic/claude-sonnet-5 rather than a native Anthropic model name. Any chat model in the catalog works through this shape, not only Anthropic’s.

Streaming

Set stream: true, or use client.messages.stream() in the SDKs, for Anthropic-style server-sent events. Credits settle when the stream ends; a disconnect still charges what the model generated. See streaming.

Tools, system prompts, and images

Use the Anthropic system, tools, and content-block formats, with Anthropic models or any other chat model in the catalog.

Headers and billing

The same x-predev-request-id, x-predev-credits-charged, and x-predev-credits-remaining headers are returned, and x-predev-project-id attributes usage. Calls are charged from the model’s metered usage, as on pricing.

Authorizations

Authorization
string
header
required

The workspace API key (pdk_…) from Integrations → Built-in in the pre.dev dashboard.

Headers

x-predev-project-id
string

Attribute this call to one of the workspace's projects. An id the workspace does not own is ignored.

Body

application/json
model
string
required

A catalog id such as anthropic/claude-sonnet-5, not a native Anthropic model name. Any chat model in the catalog works.

Example:

"anthropic/claude-sonnet-5"

messages
object[]
required
Minimum array length: 1
max_tokens
integer

The Anthropic SDKs require it.

Required range: x >= 1
system
tools
object[]

Anthropic tool definitions (name, description, input_schema).

tool_choice
object
thinking
object

Extended thinking, on models that support it.

stop_sequences
string[]
temperature
number
stream
boolean
default:false

Response

The message. With stream: true, Anthropic-style server-sent events (text/event-stream) instead.

id
string
required

Generation id (pdg-…).

type
string
required
Allowed value: "message"
role
string
required
Allowed value: "assistant"
model
string
required
content
object[]
required
stop_reason
string | null
Examples:

"end_turn"

"max_tokens"

"stop_sequence"

"tool_use"

stop_sequence
string | null
usage
object