Nbility logoNbility Docs

Search documentation

Search guides and API reference content

POST /v1/responses accepts the OpenAI Responses request shape. It organizes content as input and typed output items and is useful for clients that need newer tool, multimodal, or reasoning fields.

Endpoints

POST /v1/responses
POST /v1/responses/compact

/v1/responses/compact requests a compacted response. Availability and retained fields depend on the selected model and channel, so validate its output shape before production use.

Basic request

curl https://api.nbility.ai/v1/responses \
  -H "Authorization: Bearer $NBILITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4",
    "input": "Explain API gateways in one sentence."
  }'

Python SDK

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["NBILITY_API_KEY"],
    base_url="https://api.nbility.ai/v1",
)

response = client.responses.create(
    model="gpt-5.4",
    instructions="Be accurate and concise.",
    input="Explain API gateways in one sentence.",
)
print(response.output_text)

Common fields

FieldTypeRequiredDescription
modelstringyesA model ID that supports Responses
inputstring | arrayyesA string or typed input items
instructionsstringnoHigh-priority instructions for this response
streambooleannoReturns incremental events
max_output_tokensintegernoMaximum output tokens
toolsarraynoTool definitions; support varies by model and channel
previous_response_idstringnoContinues a previous response only when that backend supports and retains the state

Text normally appears inside message content in the output array. The official SDK exposes an output_text convenience property, but custom clients should traverse typed output items and handle tool calls, refusals, and other non-text items.

Built-in tools, server-side state continuation, and reasoning fields are not universal across compatible channels. For the broadest compatibility, use Chat Completions.