# Compatibility

> The honest parameter support table.


RavChat follows the Anthropic-compat posture: **unsupported parameters are accepted and silently ignored** so existing clients run unmodified — except where silence would corrupt semantics, which returns 400. This table is the contract.

## Request parameters

| Parameter | Behavior |
|---|---|
| `model` | honored — catalog ids; unknown → 404 |
| `messages` (system/developer/user/assistant, text parts) | honored |
| `messages` — `{type:"file"}` parts | honored |
| `messages` — `image_url`, `input_audio` parts | **400** |
| `stream`, `stream_options.include_usage` | honored |
| `max_tokens`, `max_completion_tokens` | accepted; output budget hint where the runtime can honor it |
| `response_format` `text` / `json_object` / `json_schema` | honored — native schema enforcement; no auto-retry on violation |
| `metadata` | honored — `metadata.ravchat.*` is the session/project hint namespace |
| `stop` | accepted |
| `n` | must be 1 — **400** otherwise |
| `tools`, `tool_choice`, `functions`, `function_call` | **400** in v1 — client function calling is planned v1.1 |
| `temperature`, `top_p`, `presence_penalty`, `frequency_penalty`, `logit_bias`, `seed` | ignored (the agent controls generation) |
| `logprobs`, `top_logprobs` | ignored; response `logprobs` is always `null` |
| `user`, `safety_identifier`, `prompt_cache_key` | accepted, logged for abuse attribution only |
| `store`, `service_tier`, `modalities`, `audio`, `prediction`, `reasoning_effort`, `verbosity` | ignored |

## Response fields

| Field | Behavior |
|---|---|
| `id`, `object`, `created`, `model`, `choices[]` | OpenAI-exact |
| `choices[].message.content`, `finish_reason` | honored (`stop` / `length`) |
| `choices[].message.refusal`, `choices[].logprobs` | always `null` (present) |
| `usage.prompt_tokens` / `completion_tokens` / `total_tokens` | real counts where reported; otherwise documented derived values — never fabricated |
| `usage.cost` | **RavChat extension** — credits charged |
| `x_ravchat` | **RavChat extension** — project/session/files context |
| `system_fingerprint` | not emitted |

## Client notes

<CardGroup cols={2}>
  <Card title="openai-python / openai-node" icon="python">
    Full support incl. streaming; unknown fields like `x_ravchat` are preserved (`model_extra` in Python).
  </Card>
  <Card title="LangChain ChatOpenAI" icon="link">
    invoke + streaming + `with_structured_output` (json_schema) work; agent tool-loops need v1.1 function calling.
  </Card>
  <Card title="LiteLLM" icon="filter">
    Works — `api_base` must keep the `/v1` suffix. LiteLLM drops unknown body fields; read the `x-ravchat-*` **headers** for project/session ids.
  </Card>
  <Card title="Vercel AI SDK" icon="triangle">
    `createOpenAICompatible`; use `includeUsage` for `usage.cost`.
  </Card>
</CardGroup>

## Known deviations from OpenAI

1. Live project files are **mutable** (the agent may edit them after indexing) — managed uploads are immutable. See [Files](/guides/files).
2. Sampling parameters are ignored — the agent governs its own generation.
3. No token-based rate-limit headers — credits are the budget.
4. `n>1`, client tools, and non-text input parts *other than file parts* are rejected rather than emulated (v1).
