Choosing an API

Model API speaks three request formats — the Responses API, Chat Completions, and the Messages API. All three run the same models, use the same bearer-token auth, and cost the same per token. Pick the format your code already speaks; the model and features underneath are identical.

At a glance

FormatEndpointBest forReasoning across turns
ResponsesPOST /v1/responsesAgents and multi-step tool loops; the full feature setYes — encrypted replay or previous_response_id
Chat CompletionsPOST /v1/chat/completionsDropping into existing OpenAI messages-array codeNo (reasoning is not carried between turns)
MessagesPOST /v1/messagesAnthropic-format tools such as Claude CodeYes — via Anthropic thinking replay

Responses API

The recommended default for new work. It is OpenAI-compatible and exposes the full feature set: cross-turn reasoning replay (stateless encrypted items or server-managed previous_response_id), search grounding, tool search, background execution, and file inputs. Reach for it for agentic and coding workloads where reasoning continuity across tool turns matters. Use the OpenAI SDK pointed at https://api.meta.ai/v1. See the Responses API guide.

Chat Completions

The classic OpenAI messages-array endpoint. It is the simplest drop-in if your code already calls /v1/chat/completions: point the client at the base URL, swap the key, and keep the rest. It does not carry reasoning across turns for external keys, and search grounding runs on the Responses API only. Tool calling with function tools is fully supported. See the Chat Completions guide.

Messages API

An Anthropic Messages-compatible wire format over the same inference pipeline as Responses. Use it for Claude-oriented tools and the Anthropic SDK — point the SDK at the base host https://api.meta.ai (it appends /v1/messages) with your MODEL_API_KEY. It is stateless, so replay history client-side. See the Messages API guide.

How to choose

  • Building an agent or coding workflow: use the Responses API for reasoning continuity, search grounding, and background execution.
  • Already have OpenAI chat.completions code: start with Chat Completions for the fastest drop-in, and move to Responses when you need reasoning replay or search grounding.
  • Using Claude Code or the Anthropic SDK: use the Messages API and keep your existing Anthropic-format requests.

Next steps