AibubuDevelopers
Developer Docs

Responses

Call text models with an OpenAI Responses compatible API.

POST /v1/responses is for text models. Use a public model ID returned by GET /v1/models; use /v1/generations for image and video tasks.

Request fields

FieldTypeRequiredDescription
modelstringYesPublic text model ID
inputstring or arrayYesCurrent input or ordered multi-turn messages
instructionsstringNoSystem-level instructions
streambooleanNoReturn SSE deltas; defaults to false
reasoningobjectNoReasoning configuration such as { "effort": "high" }

System instructions

Do not send a custom systemPrompt field. Use top-level instructions:

{
  "model": "gpt_5_6_luna",
  "instructions": "Answer in Chinese and provide runnable code.",
  "input": "Write a Python example."
}

For multi-turn conversations, pass ordered messages in input:

{
  "model": "gpt_5_6_luna",
  "input": [
    { "role": "user", "content": "Write a crawler." },
    { "role": "assistant", "content": "Which language?" },
    { "role": "user", "content": "Python" }
  ]
}

Streaming

Set stream to true to receive text/event-stream deltas:

data: {"type":"response.output_text.delta","delta":"Here is"}
data: {"type":"response.output_text.delta","delta":" a Python example."}
data: {"type":"response.completed"}

Compact and WebSocket

  • POST /v1/responses/compact uses the Responses contract for compact-context requests.
  • GET /v1/responses is a WebSocket Upgrade entry point; a normal GET does not return a response.

Common errors

  • Model not found or not authorized.
  • No available route.
  • Unsupported parameter.
  • Insufficient balance.
  • Upstream failure.