DEVUP Docs
Back to Dashboard
Modern API Interface

Responses API

DEVUP AI provides an OpenAI-compatible Responses API endpoint for supported models. This endpoint exposes a structured request/response interface with native Responses output payloads, built-in reasoning configuration, and transparent billing in Algerian Dinar (DZD).

POST
https://api.devupai.com/v1/responses

Current limitation: Non-streaming requests only

Streaming is not currently supported on /v1/responses. Requests must set stream: false or omit the parameter entirely. Sending stream: true returns an HTTP 400 streaming_not_supported error.

Authentication & Billing

The Responses API uses standard Bearer token authentication with your existing DEVUP AI API key. It connects directly to our canonical billing engine, applying exact balance reservation and settlement in Algerian Dinar (DZD) without separate subscription tiers or secondary ledgers.

Authorization: Bearer <YOUR_API_KEY>

Quick Start

You can interact with /v1/responses using official OpenAI SDKs or standard HTTP clients by setting the base URL to https://api.devupai.com/v1.

import os
from openai import OpenAI

# Initialize client pointing to DEVUP AI gateway
client = OpenAI(
    api_key=os.environ.get("DEVUP_API_KEY"),
    base_url="https://api.devupai.com/v1",
)

# Call the Responses endpoint with a compatible model
response = client.responses.create(
    model="openai/gpt-5.3-codex",
    input="Explain how quantum entanglement enables quantum key distribution.",
    max_output_tokens=1024,
)

# Output items are preserved in provider-native format
for item in response.output:
    if item.type == "message":
        for content in item.content:
            if content.type == "text":
                print(content.text)

# Token usage metrics
print(f"Input: {response.usage.input_tokens}, Output: {response.usage.output_tokens}")

Note: Examples use openai/gpt-5.3-codex, or another catalog model configured for Responses compatibility.

Request Parameters

The DEVUP AI gateway accepts native Responses parameters and validates them before forwarding to the upstream provider.

ParameterTypeRequirementDescription
modelstringRequiredIdentifier of a Responses-compatible catalog model.
inputstring | arrayOptionalThe text prompt or array of input content items to process.
instructionsstringOptionalSystem-level instructions directing the model's behavior.
max_output_tokensintegerOptionalCeiling on generated output tokens. Must be a positive integer within model capabilities.
reasoningobjectOptionalNested reasoning object. Supports effort (accepted values vary by model; see Reasoning Configuration below).
temperaturenumberOptionalSampling temperature. Passed through to compatible providers.
top_pnumberOptionalNucleus sampling threshold.
userstringOptionalEnd-user identifier for abuse monitoring and logging.
metadataobjectOptionalDeveloper metadata key-value pairs attached to the request.
storebooleanForced FalseDEVUP AI strictly forces store: false upstream to ensure zero data retention. Client values are overridden.
streambooleanOmit / FalseStreaming is not supported. Must be omitted or false. Setting true returns HTTP 400.

Reasoning Configuration

In the Responses API, reasoning parameters must be nested under the reasoning object. Top-level parameters such as Chat's reasoning_effort are explicitly rejected with an HTTP 400 error. Accepted effort levels depend on the model:

ModelAccepted Values
openai/gpt-5.3-codexnone, low, medium, high, xhigh
openai/gpt-5.5-promedium, high (none and low not accepted)
openai/gpt-5.4-promedium, high (none and low not accepted)
json
{
  "model": "openai/gpt-5.3-codex",
  "input": "Prove whether P equals NP or explain why the problem remains unresolved.",
  "reasoning": {
    "effort": "high"
  },
  "max_output_tokens": 2048
}

Native Responses Output

The endpoint returns the provider-native Responses object rather than Chat Completions choices[]. DEVUP AI cleanses provider infrastructure headers, preserves structured content parts, and attaches canonical billing telemetry under _devup.

json
{
  "id": "resp_01j8k9m0n1p2q3r4s5t6u7v8w9",
  "object": "response",
  "created_at": 1700000000,
  "model": "openai/gpt-5.3-codex",
  "status": "completed",
  "output": [
    {
      "id": "msg_01j8k9m0n1p2q3r4s5t6u7v8wa",
      "type": "message",
      "role": "assistant",
      "content": [
        {
          "type": "text",
          "text": "Quantum key distribution (QKD) leverages the fundamental quantum principle..."
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 24,
    "output_tokens": 182,
    "total_tokens": 206,
    "input_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0
    },
    "output_tokens_details": {
      "reasoning_tokens": 0
    }
  },
  "_devup": {
    "cost_dzd": "<settled_cost_dzd>",
    "balance_dzd": "<remaining_balance_dzd>"
  }
}

Usage Metrics & Token Accounting

The usage object reports detailed token metrics normalized by DEVUP AI:

input_tokens
Total prompt tokens counted for the input request.
output_tokens
Total tokens generated by the model (including reasoning tokens).
input_tokens_details.cached_tokens
Prompt tokens served from cache with discounted billing rates.
output_tokens_details.reasoning_tokens
Internal reasoning tokens generated prior to final answer output.

Model Compatibility

Responses API compatibility is capability-based. Not all models in the catalogue support the Responses protocol. To use this endpoint, the target model must support the native Responses protocol and input-token preflight counter.

If a request targets a model whose provider destination does not support the Responses protocol, the gateway fails safely with an HTTP 400 unsupported_destination error before reserving funds or invoking upstream resources. Check the Model Catalog for compatible model identifiers.

Error Reference

The Responses API adheres to the standard DEVUP AI error envelope. For the complete reference of gateway error codes, visit the API Error Reference.

StatusError CodeDescription & Resolution
400missing_modelThe model parameter is missing or empty. Provide a valid model string.
400streaming_not_supportedThe request specified stream: true. Set stream: false or omit the parameter.
400unsupported_parameterAn unsupported parameter was provided. Top-level reasoning_effort must be moved to reasoning: { effort }; multi-turn continuation parameters are not supported (provide full conversation in input).
400unsupported_destinationThe selected model does not support the Responses protocol. Select a compatible model from the catalog.
400invalid_request_errormax_output_tokens must be a positive integer within model limits.
401missing_api_key / invalid_api_keyProvide a valid active API key in the Authorization: Bearer header.
402insufficient_balanceYour DZD balance is insufficient for the request reservation. Top up via the dashboard.
404model_not_foundThe requested model identifier was not found in the DEVUP AI catalog.
429rate_limit_exceededStandard per-account rate limit (100 req/min) reached. Back off and retry.

Related Guides