API referenceAdvanced usersUpdated
POST/v1/responses

API console

POST/v1/responses
View keys

Requests use the API key you enter and follow standard API billing.

OpenAI Responses

Send input using the OpenAI Responses format. This page shows HTTP streaming. See the related guide for Codex client setup.

Before you start

Follow the quickstart to get an API key and select an endpoint that accepts direct HTTP calls. The example reads the Bearer token from ICODEEASY_API_KEY. Replace YOUR_MODEL_ID with a model ID supported by your endpoint.

Request example

Set model and input, then use stream: true for SSE.

bash
curl -N -sS https://api.icodeeasy.cc/v1/responses \
  -H "Authorization: Bearer $ICODEEASY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
  "model": "YOUR_MODEL_ID",
  "input": "Say hello.",
  "stream": true
}'

Read the response

Append delta from response.output_text.delta. response.completed signals success. response.incomplete carries a reason in response.incomplete_details. Handle response.failed or error as failures even if HTTP already returned 200.

text
event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"Hello!"}

event: response.completed
data: {"type":"response.completed","response":{"id":"resp_example","status":"completed","usage":{"input_tokens":10,"output_tokens":4,"total_tokens":14}}}

Read input_tokens and output_tokens from response.usage in the terminal event. When present, input_tokens_details.cached_tokens is the cached portion of the input.