> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.asi1.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.asi1.ai/_mcp/server.

# OpenAI Compatibility

> Use ASI:One with the OpenAI client libraries - supported parameters, the two endpoints, and ASI:One's own parameters

## Overview

ASI:One implements both of OpenAI's request formats, so you can use the existing
OpenAI client libraries and change only the base URL:

* **[`/v1/chat/completions`](/documentation/build-with-asi-one/chat-completions)** -
  the Chat Completions format. The default, and what every example in these docs
  uses unless it says otherwise.
* **[`/v1/responses`](/documentation/build-with-asi-one/responses)** - the
  Responses format, including retrieving, chaining, cancelling and deleting a
  response by id.

Each endpoint supports its own OpenAI parameter set. Where they differ, the
sections below say which endpoint to use.

## API compatibility

### Standard OpenAI parameters

These take the same values on `/v1/chat/completions` as they do on OpenAI's API:

| Parameter              | What it does                                                                                                                                      |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model`                | The ASI:One model to use. See [Models](/documentation/models).                                                                                    |
| `messages`             | The conversation so far.                                                                                                                          |
| `temperature`          | Sampling temperature, `0` to `2`.                                                                                                                 |
| `top_p`                | Nucleus sampling probability mass.                                                                                                                |
| `max_tokens`           | Upper bound on the tokens generated.                                                                                                              |
| `stop`                 | Up to four strings that end generation when produced.                                                                                             |
| `stream`               | Stream the reply as server-sent events.                                                                                                           |
| `tools`, `tool_choice` | See [Tool Calling](/documentation/build-with-asi-one/tool-calling).                                                                               |
| `parallel_tool_calls`  | Whether the model may call several tools in one turn.                                                                                             |
| `response_format`      | See [Structured Data](/documentation/build-with-asi-one/structured-data).                                                                         |
| `reasoning_effort`     | How deeply the model reasons, on `/v1/chat/completions`. See [Reasoning](/documentation/build-with-asi-one/reasoning#choosing-a-reasoning-depth). |
| `web_search_options`   | Gives the model live web search, on `/v1/chat/completions`. See [Web Search](/documentation/build-with-asi-one/web-search).                       |

On `/v1/responses` the same set applies, with `input` in place of `messages` and
`max_output_tokens` in place of `max_tokens`, plus `store`, `metadata`,
`background` and [`reasoning`](/documentation/build-with-asi-one/reasoning).
`stop`, `reasoning_effort` and `web_search_options` belong to
`/v1/chat/completions` alone. On `/v1/responses` the depth goes in the nested
`reasoning.effort`, and a top-level `reasoning_effort` there is rejected with a
`400`; search is the hosted `web_search` tool instead. See [Responses API](/documentation/build-with-asi-one/responses).

Structured output is the one parameter that changes shape between the two:
`response_format` on `/v1/chat/completions`, `text.format` on `/v1/responses`.
[Structured Data](/documentation/build-with-asi-one/structured-data#on-the-responses-api)
shows both.

> **Tip**
>
> Each model is tuned for the sampling values it was evaluated at, so send
> `temperature` and `top_p` only when you have a reason to move them. See
> [Sampling defaults](/documentation/models#sampling-defaults) for the values
> and for when deviating helps.

### Unrecognized parameters

A request carrying a top-level field the endpoint does not recognize is rejected
with a `400`, and the error names the field:

```json
{
  "error": {
    "message": "unknown parameter: max_token",
    "type": "invalid_request_error",
    "code": "unknown_parameter",
    "param": "max_token",
    "status": 400
  }
}
```

This is deliberate. A misspelled `max_token` fails immediately and tells you
what to fix, rather than being dropped and leaving you to work out why the reply
ignored your limit.

In [planner mode](/documentation/build-with-asi-one/planner) the planner manages
its own model calls and takes `temperature` alone.

## Custom parameters

These are specific to ASI:One and have no OpenAI equivalent.

| Parameter         | Endpoint               | What it does                                                                                                                                          |
| ----------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `planner_mode`    | `/v1/chat/completions` | Routes the request to the planner. See [Planner Mode](/documentation/build-with-asi-one/planner).                                                     |
| `agents`          | `/v1/chat/completions` | Agentverse addresses the planner may use. See [Planner Mode](/documentation/build-with-asi-one/planner).                                              |
| `enable_thinking` | Both                   | Whether the model reasons first. See [Reasoning](/documentation/build-with-asi-one/reasoning).                                                        |
| `thinking_budget` | Both                   | The older way to size reasoning, superseded by `reasoning_effort`. See [Reasoning](/documentation/build-with-asi-one/reasoning#legacy-depth-control). |

All four are top-level fields. With the OpenAI SDK, pass them through
`extra_body` so they land at the top level of the request body. `reasoning_effort`
is not one of them: it is a standard OpenAI field, so the SDK sends it directly.

## Next steps

1. **[Chat Completions API](/documentation/build-with-asi-one/chat-completions)** - The default endpoint in full, including streaming
2. **[Responses API](/documentation/build-with-asi-one/responses)** - The stateful endpoint, with retrieve and chaining
3. **[Reasoning](/documentation/build-with-asi-one/reasoning)** - The ASI:One parameters alongside OpenAI's `reasoning` object
4. **[Planner Mode](/documentation/build-with-asi-one/planner)** - Multi-step work against Agentverse agents and tools