We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.

Responses

Endpoints

Responses

Use POST /responses on api14 with the OpenAI Responses API format, including input items, tools, streaming and structured output.

Try it in the playground

The Responses endpoint accepts the OpenAI Responses API format, so client.responses.create(...) in the official SDKs works without changes. It runs on the same models as Chat completions. api14 forwards the body upstream unchanged and bills the usage that comes back.

POST https://api14.com/api/v1/responses
Authorization: Bearer sk-api14-...
Content-Type: application/json

Request

ParameterTypeDescription
modelstring, requiredModel id, e.g. openai/gpt-5-mini.
inputstring | array, requiredA prompt string or an array of input items ({ role, content } messages, function_call_output, …).
instructionsstringSystem-level instructions.
streambooleanStream semantic events (response.output_text.delta, response.completed, …) over SSE.
max_output_tokensintegerUpper bound on generated tokens.
temperature, top_pnumberSampling controls.
tools, tool_choice, parallel_tool_callsFunction tools. Web search is also available as a tool or through plugins.
textobjectOutput format, e.g. { "format": { "type": "json_schema", "name": "...", "schema": {...} } }.
reasoningobject{ "effort": "low" | "medium" | "high" }. See Reasoning.
provider, models, pluginsSame gateway extensions as chat completions.

The gateway doesn't store your conversations, so pass the full context in input with every call. Stateful options like previous_response_id may not be supported.

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api14.com/api/v1",
  apiKey: process.env.API14_API_KEY,
});

const result = await client.chat.completions.create({
  "model": "openai/gpt-5-mini",
  "messages": [
    {
      "role": "user",
      "content": "Explain vector databases in two sentences."
    }
  ]
});
console.log(result.choices[0].message.content);

The example above uses chat completions. With the Node SDK, the Responses equivalent looks like this:

const response = await client.responses.create({
  model: "openai/gpt-5-mini",
  input: "Write a haiku about APIs.",
});
console.log(response.output_text);

Response

{
  "id": "resp-1760000000-abc123",
  "object": "response",
  "created_at": 1760000000,
  "model": "openai/gpt-5-mini",
  "status": "completed",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [{ "type": "output_text", "text": "Requests in flight,\nJSON answers drifting back,\none key opens all." }]
    }
  ],
  "usage": {
    "input_tokens": 14,
    "output_tokens": 22,
    "total_tokens": 36,
    "input_tokens_details": { "cached_tokens": 0 },
    "output_tokens_details": { "reasoning_tokens": 0 },
    "cost": 0.0000475
  }
}

The gateway reads usage from the final object, or from the response.completed event when streaming, and debits cost in USD from your balance.

Errors

Same as chat completions: 400 model_required, 400 invalid_json, 401 invalid_api_key, 402 insufficient_balance, 403 model_not_allowed / plan_required, 404 model_not_found, 413 payload_too_large, 429 rate_limited / daily_limit_reached, 502 upstream_unavailable. See Errors.