Specify endpoint and API key
Python
JavaScript / TypeScript
curl
The base URL for the Anthropic SDK is
https://api.fireworks.ai/inference (without the /v1 suffix). The SDK appends /v1/messages automatically.Usage
Use the Anthropic SDK as you normally would. Just ensure that themodel parameter refers to one of the Fireworks models.
The Serverless Quickstart includes Anthropic SDK examples for all common use cases:
API compatibility
Supported endpoint
Fireworks supports the Anthropic/v1/messages endpoint, including both non-streaming and streaming (SSE) responses.
Deployment support
Anthropic compatibility is supported for both serverless and on-demand deployments. However, requests must go throughapi.fireworks.ai/inference — direct route endpoints are not supported.
Differences from Anthropic
The following parameters and fields are handled differently or are not supported:model: Must be a Fireworks model identifier (e.g.,accounts/fireworks/models/deepseek-v3p1) instead of an Anthropic model name. See the Fireworks Model Library for available models.max_tokens: Optional on Fireworks (required on Anthropic).anthropic-versionheader: Not required. Fireworks ignores this header.usagefield: Not included in the responseMessageobject.service_tier: Not supported. Removed from request parameters.inference_geo: Not supported. Removed from request parameters.
Reasoning effort mapping
When using thethinking parameter with an effort level via output_config, the Anthropic effort values are mapped to Fireworks reasoning_effort:
| Anthropic effort | Fireworks mapping |
|---|---|
low | low |
medium | medium |
high | high |
max | high |
The
adaptive thinking type is not yet supported.Unsupported features
The following Anthropic features are not available on Fireworks:- Server tools:
bash,text_editor, andweb_searchserver-side tools are not supported. eager_input_streaming: Not supported on theToolschema.cache_control: Not supported on theToolschema.server_tool_use: Not included in usage tracking.
Fireworks extensions
The following Fireworks-specific extensions are available on the Anthropic-compatible endpoint:raw_output: A request parameter (boolean) that, when set totrue, returns low-level details of what the model sees in the response, including the formatted prompt and function calls. The response will include araw_outputobject withprompt_fragmentsand other debugging information.