# Responses

Generate a response with a model that supports the Responses API.

## Endpoint

`POST https://mia-ai-proxy.ambr.io/v1/responses`

For the OpenAI SDK, see [Native APIs](https://mia-ai-proxy.ambr.io/docs/native-apis.md#openai-sdk).

## Request

Set `MIA_MODEL` to a Responses model ID from [Explore](https://mia-ai-proxy.ambr.io/explore).

```bash
curl "https://mia-ai-proxy.ambr.io/v1/responses" \
  -H "Authorization: Bearer $MIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"model\":\"$MIA_MODEL\",\"input\":\"Hello\",\"store\":false}"
```

For a subsequent turn, preserve the complete response output or response ID as appropriate for your integration. A stored reference may not be portable to another model or route; if you receive `supplier_state_not_portable`, start a new turn with portable history.

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `model` | string | Required. ID of a model that supports Responses. |
| `input` | string or array | Required. Text or structured input for the model. |
| `store` | boolean | Optional. Whether to store the response for later use. |
| `stream` | boolean | Optional. Set to `true` to receive events as they are generated. |

## Response

A non-streaming text response includes:

```json
{
  "id": "resp_example",
  "status": "completed",
  "output": [{"type": "message", "role": "assistant", "content": [{"type": "output_text", "text": "Hello!"}]}]
}
```

Fields and content vary by model and request.

## Streaming

Set `stream` to `true` to receive events as output is generated. See [Streaming](https://mia-ai-proxy.ambr.io/docs/streaming.md).
