API Documentation
Claude Fable 5 API
Anthropic's safe, general-availability Claude Fable 5 delivers long-context reasoning, coding, vision, and agentic workflows with a 1M-token context window for teams.
Endpoint
POST https://api.defapi.org/api/v1/messages
Model
anthropic/claude-fable-5
Price
$5 input / $25 output per 1M tokens
Authentication
Send your API key in the Authorization header using Bearer token format.
Authorization: Bearer <your-api-key>Create a Message
The endpoint is compatible with Claude-style Messages requests and supports both non-streaming JSON responses and streaming responses.
curl https://api.defapi.org/api/v1/messages \
-H "Authorization: Bearer dk-1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-fable-5",
"messages": [
{
"role": "user",
"content": "Explain how to migrate a large Next.js codebase."
}
],
"max_tokens": 512,
"temperature": 0.7,
"stream": false
}'Request Parameters
| Name | Type | Description |
|---|---|---|
| model | string | Required. Use anthropic/claude-fable-5. |
| messages | array | Required. Conversation messages with role and content. |
| max_tokens | integer | Maximum number of tokens to generate. |
| temperature | number | Controls randomness. Supported range: 0 to 2. |
| top_p | number | Nucleus sampling parameter. Supported range: 0 to 1. |
| stream | boolean | Set true to receive server-sent event style streaming. |
| stop | string | Up to 4 sequences where generation should stop. |
| user | string | A unique identifier for your end user. |
Streaming Request
Set stream to true to receive server-sent event style chunks.
{
"model": "anthropic/claude-fable-5",
"messages": [
{
"role": "user",
"content": "Tell me a short story about a brave knight."
}
],
"max_tokens": 512,
"temperature": 0.7,
"stream": true
}Non-Streaming Response
A successful non-streaming request returns the assistant message and token usage.
{
"id": "msg_01ABCDxyz",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-fable-5",
"stop_reason": "end_turn",
"stop_sequence": null,
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"usage": {
"input_tokens": 20,
"output_tokens": 50,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0
}
}Error Responses
400
Bad request
Invalid parameters or missing required fields.
401
Unauthorized
Invalid or missing API key.
500
Internal server error
Unexpected server-side failure.