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

# Responses

> Create a model response using the Responses API format through the attested Confidential AI gateway.

Creates a model response using the Responses API request and response format. Like other inference endpoints, requests are served through the attested gateway and return an `x-receipt-id` header for verification.

## Endpoint

```bash theme={"system"}
POST https://inference.phala.com/v1/responses
```

## Request Body

<ParamField body="model" type="string" required>
  Model id, for example `phala/qwen3.5-27b` or another id returned by [List Models](/phala-cloud/confidential-ai/confidential-model/api-reference/models).
</ParamField>

<ParamField body="input" type="string | array" required>
  Input prompt. This can be a string or an array of input items.
</ParamField>

<ParamField body="tools" type="array">
  Tool definitions the model may call.
</ParamField>

<ParamField body="temperature" type="number">
  Sampling temperature.
</ParamField>

<ParamField body="top_p" type="number">
  Nucleus sampling.
</ParamField>

<ParamField body="provider" type="object">
  Routing constraints for this request, applied together. `zdr` restricts routing to providers that do not retain content; `aci_verified` restricts it to an upstream verified inside the TEE; `aci_session_ids` pins it to specific attested channels.

  ```json theme={"system"}
  {"provider": {"aci_verified": true}}
  ```

  If no provider satisfies the constraints the request fails before the prompt is sent, and failover retries stay inside the allowed set. Field reference: [Chat Completions](/phala-cloud/confidential-ai/confidential-model/api-reference/chat-completions#body-provider). See [Attested Routing](/phala-cloud/confidential-ai/confidential-model/attested-routing) and [Zero Data Retention](/phala-cloud/confidential-ai/confidential-model/zero-data-retention).
</ParamField>

## Example

```bash theme={"system"}
curl https://inference.phala.com/v1/responses \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "phala/qwen3.5-27b",
    "input": "Explain attestation in one sentence."
  }'
```

## Response

```json theme={"system"}
{
  "id": "resp_023cda4f5e268c44006a30f3e0b6f4819b87536574ae6ecd14",
  "object": "response",
  "status": "completed",
  "model": "phala/qwen3.5-27b",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [
        { "type": "output_text", "text": "Attestation proves which trusted workload served a request.", "annotations": [] }
      ]
    }
  ],
  "usage": {
    "input_tokens": 12,
    "output_tokens": 10,
    "total_tokens": 22
  }
}
```

Read assistant text from `output[].content[].text` on `message` items. Reasoning models may also return `reasoning` items.

## Verification

Capture `x-receipt-id` from the HTTP response and verify it with [Get Receipt](/phala-cloud/confidential-ai/confidential-model/api-reference/receipts). The receipt proves the response bytes and records whether the upstream provider was verified.

## Related

<CardGroup cols={2}>
  <Card title="Chat Completions" icon="comments" href="/phala-cloud/confidential-ai/confidential-model/api-reference/chat-completions" />

  <Card title="Verify a Response" icon="circle-check" href="/phala-cloud/confidential-ai/verify/verify-signature" />
</CardGroup>
