---
title: "Create an OpenAI-compatible Chat Completion"
method: POST
path: "/chat/completions"
---

# Create an OpenAI-compatible Chat Completion

`POST /chat/completions`

## Request

- Base URL: `https://reapi.ai/api/v1`
- URL: `https://reapi.ai/api/v1/chat/completions`
- Auth: HTTP bearer

Existing Chat Completions clients retain this endpoint and response shape. Parameter support varies by model. Native Claude fields are accepted as extensions for Opus 5.5, Fable 5 and Fable 5.1; explicit native options take precedence over compatibility mappings. No automatic retries.

## Headers

- `anthropic-version` string
- `anthropic-beta` string

## Request body

- object
  - `model` 'gemini-4-argon' | 'gemini-3.6-flash' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6-luna' | 'claude-haiku-5-5' | 'claude-sonnet-5-5' | 'claude-opus-5-5' | 'claude-fable-5-1' | 'claude-fable-5' | 'claude-opus-4-8' | 'kimi-k3' | 'deepseek-v4-flash' | 'deepseek-v4-pro' | 'deepseek-v4.1-flash', required
  - `messages` object[], required
    - `role` string, required
    - `content` union
      - string
      - object[]
    - `tool_calls` object[]
    - `tool_call_id` string
    - `anthropic_content` object[]: For the native Claude models, preserve full assistant content returned by reAPI, including thinking signatures and tool blocks.
  - `stream` boolean
  - `max_tokens` integer: Optional model-specific output cap. Zero is forwarded for native Claude cache warmup. When both cap fields are supplied, the smaller value is used.
  - `max_completion_tokens` integer
  - `reasoning_effort` string: Model-specific effort. Maps to output_config.effort for native Claude models unless the native field is explicitly supplied.
  - `tools` object[]
  - `tool_choice` union
    - string
    - object
  - `parallel_tool_calls` boolean
  - `response_format` object: Native Claude maps json_schema to output_config.format without rewriting the schema. Its legacy json_object option remains accepted but does not enforce a JSON schema.
  - `stop` union
    - string
    - string[]
  - `temperature` number
  - `top_p` number
  - `n` integer
  - `stream_options` object
  - `system` union
    - string
    - object[]
  - `output_config` object: Native effort and structured output. output_config.format.schema is preserved unchanged. Supported effort values depend on the model; see its API documentation.
  - `thinking` object: Official thinking options. Thinking modes depend on the model. Haiku 5.5 supports disabled thinking; Sonnet 5.5 supports between_tools at low, medium or high effort. Beta options pass through.
  - `stop_sequences` string[]
  - `cache_control` object, nullable
  - `top_k` integer
  - `metadata` object
  - `container` union
    - string
    - object
  - `diagnostics` object, nullable: Forwarded unchanged. Availability and parameter behavior are determined upstream; acceptance alone does not verify an effect.
  - `service_tier` string: Forwarded unchanged. Availability and parameter behavior are determined upstream; acceptance alone does not verify an effect.
  - `inference_geo` string, nullable: Forwarded unchanged. Availability and parameter behavior are determined upstream; acceptance alone does not verify an effect.
  - `context_management` object, nullable
  - `mcp_servers` object[]
  - `speed` string, nullable: Forwarded unchanged. Availability and parameter behavior are determined upstream; acceptance alone does not verify an effect.
  - `fallbacks` union: Forwarded unchanged. Availability and parameter behavior are determined upstream; acceptance alone does not verify an effect.
    - string
    - object[]
  - `fallback_credit_token` union: Forwarded unchanged. Availability and parameter behavior are determined upstream; acceptance alone does not verify an effect.
    - string
    - object
  - `compaction` object, nullable
  - `output_format` object, nullable

## Response `200`

Chat Completion or SSE chunks

- object
  - `id` string
  - `object` 'chat.completion'
  - `model` string
  - `choices` object[]
  - `usage` object

## Other responses

- `400`: Invalid request or unsupported model
- `401`: Missing or invalid reAPI key
- `402`: Insufficient credits
- `403`: Access denied
- `413`: Request body too large
- `429`: Rate or concurrency limit exceeded
- `502`: Invalid or unavailable model response
- `503`: Pricing, configuration, or requested capability unavailable

---

[API](https://skmtc.dev/reapi/apis/reapi-http-api.md) - [All operations](https://skmtc.dev/reapi/apis/reapi-http-api/llms.txt) - [OpenAPI document](https://skmtc.dev/reapi/apis/reapi-http-api/revisions/1d2713a6058a?raw)
