Create a model response

POST /v1/responses

Generates a model response using the OpenAI-compatible Responses API. Works with any text model in the catalog; pass its model id as model. Set stream: true to receive the response as Server-Sent Events. Storage is disabled (store: false forced). A non-streaming request returns a Responses object with a _devup billing metadata object.

Authentication

Bearer API key required.

Request body — Required

application/json

ResponsesRequest

ResponsesRequest

{
  "model": "openai/gpt-5.6-luna",
  "input": "Explain how quantum key distribution works in one paragraph.",
  "max_output_tokens": 512
}

Responses

HTTP 200

Successful response generation: a Responses object as JSON, or a stream of Server-Sent Events when stream: true.

application/json

ResponsesResponse

ResponsesResponse

{
  "id": "resp_01j8k9m0n1p2q3r4s5t6u7v8w9",
  "object": "response",
  "created_at": 1700000000,
  "model": "openai/gpt-5.6-luna",
  "status": "completed",
  "output": [
    {
      "id": "msg_01j8k9m0n1p2q3r4s5t6u7v8wa",
      "type": "message",
      "role": "assistant",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "text": "Quantum key distribution uses principles of quantum mechanics...",
          "annotations": []
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 12,
    "output_tokens": 45,
    "total_tokens": 57
  }
}

text/event-stream

string

Server-Sent Events stream of Responses events. Each event has an event: line naming its type and a data: line with the JSON event, numbered by a contiguous sequence_number. A client reads response.created, then response.output_text.delta events with the text, response.output_item.done as each output item finishes, and response.completed with the final response and its usage. If the response cannot be completed, the stream ends with response.failed followed by an error event.

"event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_01j8k9m0n1p2q3r4s5t6u7v8w9\",\"object\":\"response\",\"created_at\":1700000000,\"model\":\"deepseek-ai/DeepSeek-V4-Pro\",\"status\":\"in_progress\",\"output\":[],\"usage\":null}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_01j8k9m0n1p2q3r4s5t6u7v8wa\",\"output_index\":0,\"content_index\":0,\"delta\":\"Golden dunes\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":9,\"output_index\":0,\"item\":{\"id\":\"msg_01j8k9m0n1p2q3r4s5t6u7v8wa\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"Golden dunes at dawn...\",\"annotations\":[]}]}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":10,\"response\":{\"id\":\"resp_01j8k9m0n1p2q3r4s5t6u7v8w9\",\"object\":\"response\",\"created_at\":1700000000,\"model\":\"deepseek-ai/DeepSeek-V4-Pro\",\"status\":\"completed\",\"output\":[{\"id\":\"msg_01j8k9m0n1p2q3r4s5t6u7v8wa\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"Golden dunes at dawn...\",\"annotations\":[]}]}],\"usage\":{\"input_tokens\":14,\"output_tokens\":21,\"total_tokens\":35}}}\n"

HTTP 400

Invalid request body or unsupported parameters.

application/json

ErrorResponse

ErrorResponse

Missing model field
{
  "error": {
    "message": "The \"model\" field is required and must be a non-empty string.",
    "type": "devup_error",
    "code": "missing_model"
  }
}
Unsupported parameter reasoning_effort
{
  "error": {
    "message": "Unsupported parameter: 'reasoning_effort'. In the Responses API, this parameter has moved to 'reasoning.effort'. Use 'reasoning: { effort: ... }' instead.",
    "type": "devup_error",
    "code": "unsupported_parameter"
  }
}
Parameter not accepted
{
  "error": {
    "message": "Unsupported parameter: 'unknown_field'.",
    "type": "devup_error",
    "code": "unsupported_parameter"
  }
}
Tool type not accepted
{
  "error": {
    "message": "Tool type 'example_tool' is not available. Remove it from the request.",
    "type": "devup_error",
    "code": "unsupported_parameter"
  }
}
The model is served on another endpoint (not billed)
{
  "error": {
    "message": "This model is served on /v1/embeddings, not on /v1/responses. Send the request to /v1/embeddings.",
    "type": "devup_error",
    "code": "wrong_endpoint"
  }
}
The text model does not support the Responses API
{
  "error": {
    "message": "Model \"...\" does not support the Responses API.",
    "type": "devup_error",
    "code": "unsupported_destination"
  }
}
max_output_tokens above the model's max_output_tokens (N here)
{
  "error": {
    "message": "max_output_tokens must be between 1 and N.",
    "type": "devup_error",
    "code": "invalid_max_tokens"
  }
}
The model does not support tool calling
{
  "error": {
    "message": "This model does not support tool calling. Remove tools and tool_choice from the request.",
    "type": "devup_error",
    "code": "tools_not_supported"
  }
}
The model needs a final user message
{
  "error": {
    "message": "This model needs the conversation to end with a user message.",
    "type": "devup_error",
    "code": "conversation_must_end_with_user"
  }
}

HTTP 401

Missing, empty, or revoked API key. This response covers three distinct codes depending on the authentication path: - missing_api_key: Authorization header absent or Bearer token is empty. On GET /v1/models, GET /v1/models/{model}, GET /v1/me and GET /v1/me/avatar, which also accept the x-api-key header, the message is "Provide your API key as: Authorization: Bearer sk-devup-..., or in the x-api-key header." - invalid_api_key: Key not found, deactivated, or not valid. - token_revoked: The scoped JWT credential has been explicitly revoked.

application/json

ErrorResponse

ErrorResponse

Authorization header absent or empty Bearer token
{
  "error": {
    "message": "Provide your API key as: Authorization: Bearer sk-devup-...",
    "type": "devup_error",
    "code": "missing_api_key"
  }
}
Key not found, deactivated, or not valid
{
  "error": {
    "message": "The API key provided is invalid or has been deactivated.",
    "type": "devup_error",
    "code": "invalid_api_key"
  }
}
Scoped JWT credential has been explicitly revoked (scoped-token auth only)
{
  "error": {
    "message": "This scoped token has been revoked.",
    "type": "devup_error",
    "code": "token_revoked"
  }
}

HTTP 402

DZD balance depleted or scoped credential budget exhausted. - insufficient_balance: The DEVUP account has insufficient available balance. Also returned on POST /v1/chat/completions and POST /v1/responses for a request with a non-empty tools array that the balance does not cover in full. - budget_exhausted: The scoped credential has reached its configured budget. This code is never returned for unrestricted master API keys.

application/json

ErrorResponse

ErrorResponse

DEVUP account has insufficient available balance
{
  "error": {
    "message": "Your balance is depleted. Top up at https://devupai.com/dashboard/billing.",
    "type": "devup_error",
    "code": "insufficient_balance"
  }
}
Scoped credential budget exhausted (scoped-token auth only)
{
  "error": {
    "message": "Scoped token budget has been exhausted.",
    "type": "devup_error",
    "code": "budget_exhausted"
  }
}

HTTP 403

Account suspended or scoped credential does not permit the requested model. - account_suspended: The DEVUP account is suspended; all requests are blocked. - model_not_allowed: The scoped credential does not grant access to the requested model. This code is never returned for unrestricted master API keys. - scoped_token_not_allowed: On GET /v1/me and GET /v1/me/avatar, which accept account API keys (sk-devup-...) only, a scoped token was sent.

application/json

ErrorResponse

ErrorResponse

DEVUP account is suspended
{
  "error": {
    "message": "Account suspended. Contact support.",
    "type": "devup_error",
    "code": "account_suspended"
  }
}
Scoped credential does not permit the requested model (scoped-token auth only)
{
  "error": {
    "message": "This scoped token does not grant access to the requested model.",
    "type": "devup_error",
    "code": "model_not_allowed"
  }
}

HTTP 404

The requested model identifier was not found in the catalog. It is not retryable unless the model identifier is changed.

application/json

ErrorResponse

ErrorResponse

Model not found in catalog
{
  "error": {
    "message": "The requested model was not found.",
    "type": "devup_error",
    "code": "model_not_found"
  }
}

HTTP 429

Too many requests. error.code is rate_limit_exceeded (your account's per-minute limit), model_at_capacity (the model is momentarily at capacity; Retry-After: 5 and retry-after-ms: 5000, no X-RateLimit-* headers; the OpenAI and Anthropic SDKs retry it automatically), concurrency_limit_exceeded, tpm_limit_exceeded, or flex_capacity_unavailable. Wait the number of seconds in Retry-After before retrying.

application/json

ErrorResponse

ErrorResponse

Your account's per-minute limit is reached
{
  "error": {
    "message": "Rate limit exceeded. Please slow down your requests and try again shortly.",
    "type": "devup_error",
    "code": "rate_limit_exceeded"
  }
}
The model is momentarily at capacity
{
  "error": {
    "message": "This model is currently at capacity. Retry in a few seconds.",
    "type": "devup_error",
    "code": "model_at_capacity"
  }
}

HTTP 502

The model could not complete the request this time. Retry the request. A request that the model rejects is never returned as 502: it returns 400 with a specific code, such as tools_not_supported, conversation_must_end_with_user, empty_message_content, feature_not_supported, response_format_not_supported or invalid_request_error. - DEVUP_COMPUTE_ERROR: The model returned an empty or unreadable response, or could not complete the request this time. - response_truncated: The response stream was cut off before completing.

application/json

ErrorResponse

ErrorResponse

The model could not complete the request
{
  "error": {
    "message": "The model could not complete this request. Retry it; retrying usually succeeds.",
    "type": "devup_error",
    "code": "DEVUP_COMPUTE_ERROR"
  }
}
Response was cut off before completing
{
  "error": {
    "message": "The response was cut off before completing. Retrying will produce a complete response.",
    "type": "devup_error",
    "code": "DEVUP_COMPUTE_ERROR"
  }
}

HTTP 503

Requests are temporarily paused or the requested model is temporarily unavailable. Retry according to the delay communicated in Retry-After and/or retry-after-ms when present.

application/json

ErrorResponse

ErrorResponse

Requests are paused for a few seconds
{
  "error": {
    "message": "Requests are paused for a few seconds. Retry after the delay in the Retry-After header.",
    "type": "devup_error",
    "code": "service_unavailable"
  }
}
The requested model is temporarily unavailable
{
  "error": {
    "message": "The requested model is temporarily unavailable. Retry shortly.",
    "type": "devup_error",
    "code": "model_unavailable"
  }
}