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

# Responses

> POST /v1/responses — OpenAI Responses API on the same models.

# POST /v1/responses

The OpenAI Responses API, translated onto the same lineup, keys, and billing
as chat completions. Use it when your SDK or agent loop (Codex, OpenAI SDK
`responses`, assistants-style tooling) speaks Responses instead of chat.

```
POST https://api.refuseless.com/v1/responses
```

A response is built from one chat generation. Billing, model ids, and
error codes match `/v1/chat/completions`.

## Request

| Field | Type | Required | Notes |
| - | - | - | - |
| `model` | string | Yes | Catalog id, e.g. `glm-5.3-abliterated` |
| `input` | string / array | Yes | Prompt text, or an array of input items / messages |
| `instructions` | string | No | System prompt, prepended to the input |
| `max_output_tokens` | number | No | Output limit. Aliases: `max_completion_tokens`, `max_tokens`. Defaults to the model's max output, else its context minus the prompt. |
| `stream` | boolean | No | Default `false`. `true` returns `response.*` SSE events. |
| `temperature` / `top_p` / `stop` | — | No | Passed through where the model supports them |
| `reasoning.effort` | string | No | `off`, `low`, `high`, or `max`. `reasoning_effort` is the same field. `off` (or `none`) disables reasoning. See [Reasoning](/guides/reasoning). |
| `tools` / `tool_choice` | — | No | Passed through; function calls come back as `function_call` output items |
| `response_format` | object | No | Passed through (`text.format` also accepted) |

Stateless: every call stands alone. `previous_response_id` and server-side
conversation state are not stored — send the history you need in `input`.

## Non-streamed response

```json theme={null}
{
  "id": "resp-abc123",
  "object": "response",
  "created_at": 1700000000,
  "model": "glm-5.3-abliterated",
  "status": "completed",
  "output": [
    {
      "type": "message",
      "id": "msg-abc123",
      "status": "completed",
      "role": "assistant",
      "content": [{ "type": "output_text", "text": "…", "annotations": [] }]
    }
  ],
  "usage": { "input_tokens": 12, "output_tokens": 64, "total_tokens": 76 }
}
```

* `status` is `incomplete` when the output limit cut the generation short.
* Tool calls appear as `{ "type": "function_call", "call_id": "…", "name": "…", "arguments": "…" }` items.
* Reasoning models attach a `reasoning` item with the thinking summary.

## Streaming

Set `stream: true` for server-sent `data: {…}` frames with a `type` field:

`response.created` → `response.in_progress` → `response.output_text.delta`
(×N) → `response.output_text.done` → `response.output_item.done` →
`response.completed` (carries the full object including `usage`).

The stream closes after `response.completed` — there is no `[DONE]` sentinel.

```bash theme={null}
curl -N https://api.refuseless.com/v1/responses \
  -H "Authorization: Bearer $REFUSELESS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3-abliterated",
    "input": "Write a tight system prompt.",
    "stream": true
  }'
```

## Example

```bash theme={null}
curl https://api.refuseless.com/v1/responses \
  -H "Authorization: Bearer $REFUSELESS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3-abliterated",
    "instructions": "Be concise.",
    "input": "Write a tight system prompt.",
    "max_output_tokens": 512
  }'
```

With the OpenAI SDK, point `baseURL` at `https://api.refuseless.com/v1`
and call `client.responses.create(...)` as usual.

## Errors

Same codes as chat completions: `400` missing `model`/`input` · `401` bad
key · `402` out of credits · `404` unknown model · `429` busy/warming (honor
`retry-after`) · `503` model unavailable.


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