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

# Responses API

> A higher-level API for text generation with built-in tools and multi-turn state.

The Responses API is a newer text generation endpoint that builds on top of Chat Completions with a simpler interface, built-in tools, and optional server-side conversation state. Routeway supports it at `POST /v1/responses` for all models that advertise this endpoint.

<Info>
  The Responses API uses the same OpenAI SDK methods (`client.responses.create`). Any code written for OpenAI's Responses API works with Routeway by changing `base_url` and `api_key`.
</Info>

## Quick Example

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    import os
    from openai import OpenAI

    client = OpenAI(
        base_url="https://api.routeway.ai/v1",
        api_key=os.getenv("ROUTEWAY_API_KEY")
    )

    response = client.responses.create(
        model="gpt-4o",
        input="What is the capital of France?"
    )

    print(response.output_text)
    ```
  </Tab>

  <Tab title="Node.js">
    ```javascript theme={null}
    import OpenAI from "openai";

    const client = new OpenAI({
      baseURL: "https://api.routeway.ai/v1",
      apiKey: process.env.ROUTEWAY_API_KEY,
    });

    const response = await client.responses.create({
      model: "gpt-4o",
      input: "What is the capital of France?",
    });

    console.log(response.output_text);
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl https://api.routeway.ai/v1/responses \
      -H "Authorization: Bearer $ROUTEWAY_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-4o",
        "input": "What is the capital of France?"
      }'
    ```
  </Tab>
</Tabs>

***

## Which Models Support It?

Not every model on Routeway supports the Responses API. Check the model's `endpoints` array via `GET /v1/models`:

```json theme={null}
{
  "id": "gpt-4o",
  "endpoints": ["/v1/chat/completions", "/v1/responses"],
  ...
}
```

If `/v1/responses` is listed, the model is compatible. See [Models](/getting-started/models) for the full list.

***

## What's in This Section

<CardGroup cols={2}>
  <Card title="Request & Response" icon="arrow-right-left" href="/core-concepts/responses/request-and-response">
    The full anatomy of a Responses API request and response — input formats, output structure, and key parameters.
  </Card>

  <Card title="Multi-turn Conversations" icon="messages-square" href="/core-concepts/responses/multi-turn">
    Use `previous_response_id` to build stateful conversations without resending full message history.
  </Card>

  <Card title="Built-in Tools" icon="wrench" href="/core-concepts/responses/built-in-tools">
    Leverage web search, file search, and code interpreter without defining custom function schemas.
  </Card>
</CardGroup>
