Responses
The Responses API is a stateful way to run multi-turn conversations. Instead of resending the whole conversation on every turn, you send only the new input and reference the previous turn by its id — EcoLink keeps the conversation on the server. For reasoning models, the model's thinking is carried across turns as well, which improves quality on follow-up questions.
It is available for text-generation platform models. For a single, self-contained request, or for embeddings, vision, audio, or your own inference instances, use Chat completions instead.
POST https://api.ecohash.com/v1/responses
GET https://api.ecohash.com/v1/responses/{id}
POST https://api.ecohash.com/v1/responses/{id}/cancel
Headers
| Header | Value |
|---|---|
Authorization | Bearer eco_YOUR_KEY |
Content-Type | application/json |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | yes | A text-generation platform model, e.g. qwen3.6-27b |
input | string or array | yes | The new user input for this turn — a plain string, or an array of typed content items |
instructions | string | no | System-level guidance applied to this response |
previous_response_id | string | no | The id of the response this turn continues. Omit to start a new conversation |
max_output_tokens | integer | no | Upper bound on the generated length |
temperature | number | no | 0–2, default 1.0 |
top_p | number | no | 0–1 |
stream | bool | no | true for SSE streaming |
Create a response
curl https://api.ecohash.com/v1/responses \
-H "Authorization: Bearer eco_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.6-27b",
"instructions": "You are a concise assistant.",
"input": "What is EcoLink?"
}'
Response:
{
"id": "resp_abc123",
"object": "response",
"created_at": 1776391234,
"model": "qwen3.6-27b",
"status": "completed",
"output": [{
"type": "message",
"role": "assistant",
"content": [{"type": "output_text", "text": "EcoLink is a GPU cloud platform ..."}]
}],
"usage": {
"input_tokens": 18,
"output_tokens": 24,
"total_tokens": 42
}
}
The usage block uses input_tokens and output_tokens (billed the same as prompt_tokens / completion_tokens on chat completions). When a prior turn's context is reused, input_tokens_details.cached_tokens reports the cached portion, which is billed at the lower cache-hit rate.
Continue the conversation
Send the next turn with previous_response_id set to the prior id. You send only the new input — the earlier turns are retained on the server.
curl https://api.ecohash.com/v1/responses \
-H "Authorization: Bearer eco_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.6-27b",
"previous_response_id": "resp_abc123",
"input": "Which GPUs does it offer?"
}'
Keep model the same across a conversation. Continue from the most recent response id you received.
Retrieve a response
curl https://api.ecohash.com/v1/responses/resp_abc123 \
-H "Authorization: Bearer eco_YOUR_KEY"
Returns the response object in the same shape as the create call.
Cancel a response
curl -X POST https://api.ecohash.com/v1/responses/resp_abc123/cancel \
-H "Authorization: Bearer eco_YOUR_KEY"
Streaming
With "stream": true, the response is a sequence of data: <json>\n\n server-sent events. Each event has a type; text arrives on response.output_text.delta events, and the final response.completed event carries the full response object including usage:
data: {"type":"response.created","response":{"id":"resp_abc123","status":"in_progress"}}
data: {"type":"response.output_text.delta","delta":"Eco"}
data: {"type":"response.output_text.delta","delta":"Link"}
data: {"type":"response.completed","response":{"id":"resp_abc123","status":"completed","usage":{"input_tokens":18,"output_tokens":24,"total_tokens":42}}}
data: [DONE]
Response headers
| Header | Meaning |
|---|---|
x-ecolink-region | Region that served this request |
x-ecolink-request-id | Unique ID for this request (include in support requests) |
Error responses
See Errors for the full list. Common:
| HTTP | Meaning |
|---|---|
| 400 | Malformed body, or a model that does not support this endpoint |
| 401 | Bad or missing API key |
| 402 | Balance insufficient or model not priced |
| 404 | Unknown model ID, or a previous_response_id / response id that is no longer available |
| 429 | Rate limited |
| 503 | No healthy region for this model |
A retained conversation is available for 24 hours after its most recent turn. After that, continue from a fresh response with no previous_response_id.