Skip to main content
Recommended Use Responses API for new LLM integrations.
Responses API is the main LLM surface on NagaAI. Start here when you want one API for plain text, tools, structured outputs, streaming, reasoning, and multimodal inputs.

Best Fit

  • new LLM features without legacy protocol constraints
  • typed output flows such as tool calls and reasoning items
  • multimodal prompts that mix text with images, files, or audio
  • streaming clients that want semantic event names instead of chat chunks

Request Model

Most requests start with:
  • model
  • input
  • instructions
  • tools
  • text
  • reasoning
  • stream

Quick Example

from openai import OpenAI

client = OpenAI(
    base_url="https://api.naga.ac/v1",
    api_key="YOUR_API_KEY",
)

response = client.responses.create(
    model="gpt-4.1-mini",
    input="Summarize why observability matters in production systems.",
)

print(response.output_text)

Response Model

Successful responses are response objects with typed output[] items.
{
  "object": "response",
  "status": "completed",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Observability helps teams detect, explain, and fix production failures faster.",
          "annotations": [],
          "logprobs": []
        }
      ]
    }
  ]
}
Do not assume output[0] is always the final answer. The array can also contain reasoning, function_call, and other typed items.

Learn The API In Detail

Text Generation

Start with the simplest request and response flow.

Streaming

Parse semantic SSE events and final snapshots correctly.

Tool Calling

Work with function_call and function_call_output items.

Structured Outputs

Use text.format for schema-shaped output.

Reasoning

Control and inspect reasoning items.

Multimodal Inputs

Send images, files, and audio through typed input parts.

Web Search

Enable search through the public web-search tool shape.

Conversation State

Model multi-turn state in a stateless gateway environment.

Use Another API Only When Needed

Reference