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

# レスポンスs API

> OpenAI レスポンスs API format with function calling, built-in tools, and server-side multi-turn context

> [!NOTE]
>
> **中国本土のユーザー向け：** 中国本土のユーザーは `https://toapis.cn` を API エンドポイント（Base URL）としてご利用ください。本ドキュメント内の例では `https://toapis.com` を `https://toapis.cn` に置き換えてください。

The レスポンスs API is OpenAI's newer agentic API. Compared with Chat Completions, it adds richer tool use and server-side conversation state.

* **Function calling**: let models call custom functions
* **Built-in tools**: use tools such as `web_search_preview`
* **Server-side context**: use `previous_response_id` instead of resending the full conversation
* **Reasoning control**: tune thinking depth with `reasoning.effort`

> [!WARNING]
>
> モデル marked as **レスポンスs Only**, such as `gpt-5-pro-official` and `gpt-5.3-codex-official`, only support this API and do not support Chat Completions. See the [model list](https://docs.toapis.com/docs/ja/api-reference/chat/models.md) for details.

## Authorizations

**Authorization** `string` *required*

Use Bearer Token authentication.

```
Authorization: Bearer YOUR_API_KEY
```

Get your API key from the [API Key management page](https://toapis.com/console/token).

## Body

**model** `string` *required*

モデル name.

Examples: `"gpt-5-pro-official"`, `"gpt-5.3-codex-official"`, `"gpt-5.2-official"`

**input** `string | object[]` *required*

User input. Supports simple string input or a message array for multi-turn conversations.

**instructions** `string`

System instructions that guide model behavior.

**stream** `boolean` (default: false)

Whether to enable streaming output.

**max\_output\_tokens** `integer`

Maximum number of output tokens.

**temperature** `number` (default: 1)

Sampling temperature, from `0` to `2`.

**top\_p** `number` (default: 1)

Nucleus sampling threshold, from `0` to `1`.

**previous\_response\_id** `string`

Previous response ID for server-side multi-turn context.

**reasoning** `object`

Reasoning configuration. `reasoning.effort` can be `high`, `medium`, `low`, or `none`.

**tools** `object[]`

Available tools. Supported tool types include `function` and `web_search_preview`.

**tool\_choice** `string` (default: auto)

Tool selection policy: `auto`, `none`, or `required`.

## レスポンス

**id** `string`

Unique response ID, usable as `previous_response_id`.

**object** `string`

Always `response`.

**status** `string`

レスポンス status: `completed`, `failed`, or `in_progress`.

**output** `object[]`

Output items, such as `message`, `function_call`, `reasoning`, or `web_search_call`.

**usage** `object`

Token usage statistics, including input, output, reasoning, and total tokens.

```bash cURL theme={null}
curl --request POST \
  --url https://toapis.com/v1/responses \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-5.3-codex-official",
    "instructions": "You are a professional code assistant",
    "input": "Write a quicksort in Python"
  }'
```

```python Python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://toapis.com/v1"
)

response = client.responses.create(
    model="gpt-5.3-codex-official",
    instructions="You are a professional code assistant",
    input="Write a quicksort in Python"
)

print(response.output[0].content[0].text)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.