Skip to content

Overview

Siraya AI supports the OpenResponses API specification, an open standard for AI model interactions. OpenResponses provides a unified interface across providers with built-in support for streaming, tool calling, reasoning, and multi-modal inputs.

Base URL

The OpenResponses-compatible API is available at:

https://llm.siraya.pro/v1

Authentication

The OpenAI-compatible API supports the same authentication methods:

  • API key: Use your Siraya AI API key with the Authorization: Bearer <token> header

Supported features

The OpenResponses API supports the following features:

  • Text generation - Generate text responses from prompts
  • Streaming - Stream tokens as they're generated
  • Image input - Send images for analysis
  • Tool calling - Define tools the model can call

Supported endpoints

The Siraya AI supports the following OpenResponses endpoint:

  • POST /responses - Create chat response with support for streaming, attachments, tool calls, and structured outputs

Getting started

Here's a simple example to generate a text response:

import requests

response = requests.post(
    'https://llm.siraya.pro/v1/responses',
    headers={
        'Authorization': 'Bearer <API_KEY>',
        'Content-Type': 'application/json',
    },
    json={
        'model': 'o4-mini',
        'input': 'Hello, world!',
    }
)
const response = await fetch('https://llm.siraya.pro/v1/responses', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <API_KEY>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'o4-mini',
    input: 'Hello, world!',
  }),
});
curl -X POST https://llm.siraya.pro/v1/responses \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "o4-mini",
    "input": "Hello, world!"
  }'

Parameters

Required parameters

  • model (string): The model ID in provider/model format (e.g., openai/gpt-5.2, anthropic/claude-sonnet-4.5)
  • input (array): Array of message objects containing type, role, and content fields

Optional parameters

  • stream (boolean): Stream the response. Defaults to false
  • temperature (number): Controls randomness. Range: 0-2
  • top_p (number): Nucleus sampling. Range: 0-1
  • max_output_tokens (integer): Maximum tokens to generate
  • tools (array): Tool definitions for function calling
  • tool_choice (string): Tool selection mode: auto, required, or none
  • reasoning (object): Reasoning configuration with effort level
  • provider (object): Provider routing and configuration options

Error handling

The API returns standard HTTP status codes and error responses:

Common error codes

  • 400: Bad Request (invalid or missing params, CORS)
  • 401: Invalid credentials (OAuth session expired, disabled/invalid API key)
  • 402: Your account or API key has insufficient credits. Add more credits and retry the request.
  • 403: Your chosen model requires moderation and your input was flagged
  • 408: Your request timed out
  • 429: You are being rate limited
  • 502: Your chosen model is down or we received an invalid response from it
  • 503: There is no available model provider that meets your routing requirements

Error response format

{
    "error": {
        "message": "",
        "type": "",
        "param": "",
        "code": 429
    }
}