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

# Migration to Responses

> Move from Chat Completions to the recommended Responses API when you are ready.

Use this migration when you want to keep the same NagaAI platform behavior but move from chat-shaped requests to the main `Responses API`.

You do not need to migrate immediately. Stay on Chat Completions if your current integration already works and the migration cost is not worth it yet.

## Mental Model Shift

| Chat Completions              | Responses                                             |
| ----------------------------- | ----------------------------------------------------- |
| `messages[]`                  | `input` string or typed input items                   |
| `choices[0].message`          | `output` item array                                   |
| `delta.content`               | semantic SSE events like `response.output_text.delta` |
| `tool_calls`                  | `function_call` items                                 |
| `role: tool`                  | `function_call_output` items                          |
| repeated conversation history | `input` replay or `previous_response_id`              |

## When To Stay On Chat Completions

* you already have a large OpenAI chat integration that would gain little from migration right now
* your SDK wrappers are deeply tied to `choices[0].message`

## When To Migrate

* you are adding new tools or richer multimodal flows
* you want the primary platform surface going forward
* you want docs and examples that match the main product path

## Field mapping

| Chat Completions field                | Responses equivalent                                     |
| ------------------------------------- | -------------------------------------------------------- |
| `messages`                            | `input`                                                  |
| `system` message                      | `instructions` or a `system` / `developer` input message |
| `tools`                               | `tools`                                                  |
| `tool_choice`                         | `tool_choice`                                            |
| `stream: true`                        | `stream: true`                                           |
| tool result message with `role: tool` | `function_call_output` input item                        |

## Simple request conversion

```json Chat Completions theme={null}
{
  "model": "gpt-4.1-mini",
  "messages": [
    {
      "role": "user",
      "content": "Summarize this pull request in three bullets."
    }
  ]
}
```

```json Responses theme={null}
{
  "model": "gpt-4.1-mini",
  "input": "Summarize this pull request in three bullets."
}
```

## Tool-calling migration notes

* `tool_calls` become `function_call` items in `output[]`
* follow-up tool results become `function_call_output` items in the next `input`
* do not assume the final assistant text is always `output[0]`

## Streaming migration notes

* Chat Completions streams chat deltas
* Responses streams semantic events such as `response.output_text.delta`
* if your client parses raw delta text today, update it before switching APIs

## Next steps

* [Responses API](/api/responses)
* [Responses Streaming](/api/responses/streaming)
* [Responses Tool Calling](/api/responses/tool-calling)
