Skip to main content
POST
/
responses
Responses
curl --request POST \
  --url https://api.example.com/responses \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": {},
  "tools": [
    {}
  ],
  "temperature": 123,
  "top_p": 123
}
'
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

POST https://inference.phala.com/v1/responses

Request Body

model
string
required
Model id, for example phala/qwen3.5-27b or another id returned by List Models.
input
string | array
required
Input prompt. This can be a string or an array of input items.
tools
array
Tool definitions the model may call.
temperature
number
Sampling temperature.
top_p
number
Nucleus sampling.

Example

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

{
  "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. The receipt proves the response bytes and records whether the upstream provider was verified.

Chat Completions

Verify a Response