With the official Anthropic SDK, set base_url to the Base URL shown on this documentation site and use an sk-zerofa-* value for api_key. All other usage matches the native Anthropic API.
Request parameters
Header parameters
x-api-keystringRequiredThe native Anthropic authentication header. Use an sk-zerofa-* key. Authorization: Bearer <key> is also accepted.
Example:
sk-zerofa-xxxanthropic-versionstringRequiredThe Anthropic API version.
Example:
2023-06-01Content-TypestringRequiredExample:
application/jsonBody parametersapplication/json
modelstringRequiredA Claude model. See the complete list in the model catalog.
Example:
your-claude-model-idmax_tokensintegerRequiredThe output token limit. This field is required by the Anthropic format.
Example:
1024messagesarrayRequiredConversation history with role set to user or assistant.
Example:
[{"role":"user","content":"hi"}]systemstringOptionalThe system prompt as a top-level field, outside messages.
Example:
You are a concise assistanttemperaturenumber 0–1OptionalSampling temperature.
Example:
1.0top_pnumber 0–1OptionalNucleus sampling.
Example:
1.0stop_sequencesstring[]OptionalStop sequences.
streambooleanOptionalWhen true, returns the native Anthropic SSE event stream.
Example:
falsetools / tool_choicearray / objectOptionalNative Anthropic tools using tool_use and tool_result.
Capabilities
- Streaming, tool_use, and vision through image blocks work in the native Anthropic format.
- If you do not want to depend on the Anthropic format, use Chat Completions to switch providers with one OpenAI code path. ZeroFA translates function calls and multimodal content automatically.
Request and response bodies
Use the examples below to verify the request and response structures. To send a request, select Debug at the top of the page.
curl https://zerofa.ai/v1/messages \
-H "x-api-key: sk-zerofa-xxx" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "your-claude-model-id",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello"}]
}'Response · 200
{
"id": "msg_...",
"type": "message",
"role": "assistant",
"content": [{ "type": "text", "text": "Hello! How can I help?" }],
"model": "your-claude-model-id",
"stop_reason": "end_turn",
"usage": { "input_tokens": 10, "output_tokens": 25 }
}