claude-fable-5-2
Use Claude Fable 5.2 with native Messages or OpenAI-compatible Chat Completions, including streaming, tools, structured output and prompt caching.
Use claude-fable-5-2 for native Anthropic Messages or OpenAI-compatible Chat Completions; see the model page for current pricing.
Quick example
These examples make one native Messages request. The SDK examples disable client retries. They use a bounded output allowance, high effort and streaming; inspect the stop reason as well as visible text.
curl --no-buffer https://reapi.ai/api/v1/messages \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-fable-5-2",
"messages": [{"role":"user","content":"Review this migration plan and identify what must be verified before release."}],
"max_tokens": 4096,
"output_config": {"effort":"high"},
"stream": true
}'from anthropic import Anthropic
client = Anthropic(
api_key="YOUR_API_KEY",
base_url="https://reapi.ai/api",
max_retries=0,
)
with client.messages.stream(
model="claude-fable-5-2",
messages=[{"role": "user", "content": "Review this migration plan and identify what must be verified before release."}],
max_tokens=4096,
output_config={"effort": "high"},
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)
message = stream.get_final_message()
print("\nStop:", message.stop_reason)import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: 'YOUR_API_KEY',
baseURL: 'https://reapi.ai/api',
maxRetries: 0,
});
const stream = client.messages.stream({
model: 'claude-fable-5-2',
messages: [{ role: 'user', content: 'Review this migration plan and identify what must be verified before release.' }],
max_tokens: 4096,
output_config: { effort: 'high' },
});
stream.on('text', text => process.stdout.write(text));
const message = await stream.finalMessage();
console.log('\nStop:', message.stop_reason);package main
import (
"bytes"
"encoding/json"
"io"
"log"
"net/http"
"os"
)
func main() {
body, err := json.Marshal(map[string]any{
"model": "claude-fable-5-2",
"messages": []map[string]string{{"role": "user", "content": "Review this migration plan and identify what must be verified before release."}},
"max_tokens": 4096,
"output_config": map[string]string{"effort": "high"},
"stream": true,
})
if err != nil { log.Fatal(err) }
req, err := http.NewRequest("POST", "https://reapi.ai/api/v1/messages", bytes.NewReader(body))
if err != nil { log.Fatal(err) }
req.Header.Set("x-api-key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { log.Fatal(err) }
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK { log.Fatalf("HTTP %d", resp.StatusCode) }
// Native SSE. A production client should parse each event and stop_reason.
if _, err := io.Copy(os.Stdout, resp.Body); err != nil { log.Fatal(err) }
}Endpoints and headers
| Format | POST endpoint | Authentication |
|---|---|---|
| Native Messages | https://reapi.ai/api/v1/messages | x-api-key: YOUR_API_KEY |
| Chat Completions | https://reapi.ai/api/v1/chat/completions | Authorization: Bearer YOUR_API_KEY |
Set Content-Type: application/json. Use stream: true for native text/event-stream; otherwise the response is JSON. Both endpoints use your reAPI key and balance. reAPI supplies the default Anthropic protocol version; an explicit anthropic-version is preserved. Send anthropic-beta when an optional feature requires it.
Native parameters
The table covers the model's stable and opt-in beta request surface. Optional fields are omitted unless needed; the editor's example values are not mandatory defaults. Model parameters and unknown extensions are forwarded without a field allowlist. Authentication, body-size, output-budget and public-media-URL checks remain in place.
| Field | Type | Required / default / behavior |
|---|---|---|
model | string | Required: claude-fable-5-2 |
messages | object array | Required: user/assistant turns with native content blocks |
max_tokens | integer | Required; up to 128,000, including thinking. Zero is forwarded for documented cache-warmup behavior |
system | string or text-block array | Optional top-level instructions |
stream | boolean | Optional; default false |
output_config | object | Optional; effort defaults to high; also holds JSON-schema format and applicable beta controls |
thinking | object | Optional; adaptive thinking is always on; supports display and applicable binding controls |
tools | object array | Optional; client/server tools, complete input schemas and cache markers |
tool_choice | object | Optional; default auto, also none; forced any or named tool is rejected by the official model |
stop_sequences | string array | Optional; stops on a supplied sequence |
cache_control | object or null | Optional; ephemeral caching, TTL 5m (default) or 1h |
metadata | object | Optional request metadata |
container | string, object or null | Optional container reuse and applicable skills |
diagnostics | object or null | Optional; includes previous_message_id |
service_tier | string | Optional; default auto. This model does not support Priority Tier |
inference_geo | string or null | Optional; availability depends on the requested geography |
context_management | object or null | Optional beta context edits |
mcp_servers | object array | Optional beta MCP connector definitions |
speed | string or null | Optional; standard or fast where available; fast mode has different pricing |
fallbacks | string or object array or null | Optional official beta refusal fallback configuration |
fallback_credit_token | string or object or null | Optional official beta fallback token |
compaction | object or null | Optional beta compaction configuration |
thread | object or null | Optional beta thread state |
output_format | object or null | Deprecated beta alias; prefer output_config.format |
Effort accepts low, medium, high, xhigh, max. Manual thinking budgets and thinking.type: "disabled" are not supported. Omit temperature, top_p and top_k; reAPI does not add local rejection rules for such extension fields. The model has a 1M-token context window and accepts text and images. Media inputs must be public HTTP(S) URLs; inline base64/data URIs are not accepted.
Compatibility and structured output
OpenAI clients use base URL https://reapi.ai/api/v1. Portable fields are translated as follows; native extensions remain available.
| Chat Completions | Native Messages |
|---|---|
reasoning_effort | output_config.effort |
max_tokens / max_completion_tokens | max_tokens; the smaller explicit ceiling wins |
stop | stop_sequences |
Function tools, tool_calls, tool replies | Native tool definitions, tool_use, tool_result |
response_format.json_schema | output_config.format |
parallel_tool_calls | tool_choice.disable_parallel_tool_use |
messages system/developer turns | Top-level system |
An explicit native output_config takes precedence for the corresponding settings. The existing compatibility treatment of sampling, penalties, n, seed and logprobs remains unchanged; use native Messages for the model's own parameter format.
For structured output, provide output_config.format with type: "json_schema" and your complete schema. Constraints are preserved. Official structured-output availability has account restrictions, including CMEK organizations; passing a schema is not proof that every feature is enabled.
Pricing dimensions and billing
Input, output, cached reads, five-minute cache writes and one-hour cache writes have separate dimensions. Thinking counts as output. Optional server tools and fast mode may change a request's cost. See current token prices, and inspect response usage rather than estimating from the visible answer alone.
For token-only usage, the USD calculation is the sum of each token count multiplied by its applicable per-token rate. reAPI settles the recorded request cost, including applicable additional charges, at micro-dollar precision:
micro_usd = ceil(actual_request_cost_usd × 1,000,000)
credits = micro_usd / 1,000
1 credit = $0.001 USDThe published rate table is a quote, not a fallback billing calculation. Failed delivery, cancellation, truncation or missing trusted cost follows the existing no-charge settlement path.
Output and streaming
A non-streaming native response is a message object with id, model, role, content[], stop_reason, stop_sequence and usage. Optional diagnostics, input_transformations and stop details are retained when present. Read content by its type; the first block need not be text.
Native streaming uses message_start, content_block_start, content_block_delta, content_block_stop, message_delta and message_stop, with ping or error events where applicable. It does not emit an OpenAI [DONE] marker. Accumulate tool JSON and thinking signatures without rewriting their contents.
Compatible responses use choices, finish_reason, usage and SSE ending in [DONE]. The non-streaming assistant message includes anthropic_content for lossless replay; streaming chunks include anthropic_event. Native metadata is available under anthropic, and native usage under usage.anthropic. Return preserved blocks in the next assistant turn rather than reconstructing them from displayed text.
A classifier refusal can be HTTP 200 with stop_reason: "refusal"; the compatible finish reason is content_filter. Check the stop reason before treating any HTTP 200 response as a useful answer.
Errors
The native endpoint preserves the Messages error shape:
{"type":"error","error":{"type":"invalid_request_error","message":"..."},"request_id":"..."}| HTTP status | Meaning |
|---|---|
| 400 | Invalid request, output budget, media input or model-rejected combination |
| 401 / 403 | Authentication or permission failure |
| 402 | Insufficient balance for admission |
| 413 | Request body exceeds 32 MB |
| 429 | Rate or concurrency limit |
| 502 / 503 | Unavailable service, unusable response or unavailable pricing |
Chat Completions retains its existing compatibility error format. See the API error reference. reAPI makes one generation attempt per request; it does not automatically retry a failed call.
Moving from Fable 5.1
- Preserve prior system, tools and conversation content when replaying signed thinking. Fable 5.2 checks the conversation prefix for every account. Retrying the unchanged failing request does not repair an invalid signature.
- The official
thinking-binding-controls-2026-08-01beta can report dropped blocks throughinput_transformations; treatdrop_blockas an explicit application choice rather than silently discarding state. - Earlier models cannot read Fable 5.2 thinking blocks. Verify model switches and stored-history replay separately.
- Replace the old
computer_20251124tool with the current computer toolset where required. Update advisor model IDs together with the executor. - Re-evaluate effort and
max_tokens. A small budget may be exhausted by thinking before any text appears. Instructions to avoid thinking do not replace effort control. - Anthropic requires 30-day retention unless expressly authorized otherwise. Its optional features and platform-specific restrictions are documented separately from reAPI's forwarding behavior.
The request translation, SSE handling and billing integration have isolated contract tests. Live acceptance and demonstrated parameter effects are separate evidence: an accepted optional field can still be ignored. No claim here certifies every optional feature through a live generation test.
Related and sources
Official references reviewed November 10, 2026: model overview, migration guide, Messages, beta Messages.