> ## Documentation Index
> Fetch the complete documentation index at: https://developers.reflection.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI compatibility

> Use OpenAI SDKs and tools with the Reflection API, and what differs

The Reflection API's OpenAI-compatible endpoint, `https://api.reflection.ai/openai/v1`, implements the OpenAI Chat Completions and Models endpoints, and no others. Code that uses only those endpoints, through the OpenAI SDKs or a framework built on them, works after you change two settings:

| Setting | Value |
| - | - |
| Base URL | `https://api.reflection.ai/openai/v1` |
| API key | A [Reflection API key](/authentication) |

<CodeGroup>
  ```python Python theme={null}
  import os
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.reflection.ai/openai/v1",
      api_key=os.environ["REFLECTION_API_KEY"],
  )
  ```

  ```typescript TypeScript theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://api.reflection.ai/openai/v1",
    apiKey: process.env.REFLECTION_API_KEY,
  });
  ```
</CodeGroup>

Many tools also read the `OPENAI_BASE_URL` and `OPENAI_API_KEY` environment variables. A tool that uses Chat Completions can often switch without code changes; a tool that calls another endpoint, such as Responses, will not work:

```bash theme={null}
export OPENAI_BASE_URL="https://api.reflection.ai/openai/v1"
export OPENAI_API_KEY="$REFLECTION_API_KEY"
```

## Supported endpoints

| Endpoint | Supported |
| - | - |
| `POST /chat/completions` | Yes |
| `GET /models` | Yes |
| `GET /models/{model}` | Yes |
| Responses, Embeddings, Images, Audio, Files, Batch, Assistants, and other endpoints | No |

## Supported features

* Text messages with `system`, `developer`, `user`, `assistant`, and `tool` roles
* [Streaming](/streaming), including `stream_options.include_usage`
* [Tool calling](/tool-calling), with `tool_choice` and `parallel_tool_calls`
* [Structured outputs](/structured-outputs) with `json_object` and `json_schema`
* `temperature`, `top_p`, `frequency_penalty`, `presence_penalty`, `max_completion_tokens`, `max_tokens` (deprecated), and `seed`
* [`reasoning_effort`](/reasoning)

## Differences

### Parameters with fixed values

These parameters are accepted only at the value shown. Any other value returns a `400` error with code `unsupported_value`.

| Parameter | Accepted value |
| - | - |
| `n` | `1` |
| `logprobs` | `false` |
| `logit_bias` | `{}` |
| `store` | `false`. Completions are not stored. |
| `modalities` | `["text"]` |
| `verbosity` | `medium` |
| `service_tier` | `auto` or `default` |

### Stop sequences

`stop` is accepted, as a string or an array of up to four strings, but has no effect: generation doesn't stop at these sequences. If you need to end output at a sequence, truncate the text in your code.

### Reasoning effort

Each model accepts only the `reasoning_effort` values listed in its `reasoning.supported_efforts`, and any other value returns a `400` error with code `unsupported_value`. `Beam-501B-A23B` accepts `low`, `medium`, `high`, `xhigh`, and `max`, and applies `medium` when a request omits `reasoning_effort`. It always reasons, so there is no value such as `none` that turns reasoning off. See [Reasoning](/reasoning).

### Other parameters

Parameters that aren't listed in the [API reference](/api-reference/chat/create-a-chat-completion), such as `top_logprobs`, `audio`, `prediction`, `user`, or `metadata`, aren't supported and return a `400` error with code `unsupported_parameter`. If a framework sends one of these by default, turn it off in the framework's settings.

### Input

Message content is text only: a string, or an array of `text` parts. Image, audio, and file inputs are not supported.

### Additions

The API returns some fields that OpenAI's API does not:

| Field | Where | Description |
| - | - | - |
| `reasoning_content` | `message` and `delta`, and accepted on assistant messages in requests | The model's [reasoning](/reasoning), separate from `content`. |
| `shutdown_date`, `context_length`, `max_output_tokens`, `reasoning` | Model objects | The model's shutdown date, token limits, and [reasoning efforts](/reasoning#discover-supported-efforts). See [Models](/models). |
| `x-server-request-id`, `x-ratelimit-*-day` | Response headers | A copy of the [request ID](/errors#request-ids) in `x-request-id`, and your organization's [daily rate limits](/rate-limits#rate-limit-headers). |

### Errors

Errors use the same `{"error": {"message", "type", "param", "code"}}` shape, so SDK exception handling works unchanged. Some `code` values are specific to Reflection; see [Errors](/errors).
