Skip to content

Overview

Siraya AI provides Anthropic-compatible API endpoints, so you can use the Anthropic SDK and tools like Claude Code through a unified gateway with only a URL change.

The Anthropic-compatible API implements the same specification as the Anthropic Messages API.

For more on using Siraya AI with Claude Code, see the Claude Code instructions.

Base URL

The Anthropic-compatible API is available at the following base URL:

https://llm.siraya.pro

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 endpoints

The Siraya AI supports the following Anthropic-compatible endpoint:

  • POST /v1/messages - Create messages with support for streaming, tool calls, extended thinking, and file attachments

Configuring Claude Code

Claude Code Integration Guide

Integration with Anthropic SDK

Anthropic SDK Compatibility

Parameters

The messages endpoint supports the following parameters:

Required parameters

  • model (string): The model to use (e.g., anthropic/claude-sonnet-4.5)
  • max_tokens (integer): Maximum number of tokens to generate
  • messages (array): Array of message objects with role and content fields

Optional parameters

  • stream (boolean): Whether to stream the response. Defaults to false
  • temperature (number): Controls randomness in the output. Range: 0-1
  • top_p (number): Nucleus sampling parameter. Range: 0-1
  • top_k (integer): Top-k sampling parameter
  • stop_sequences (array): Stop sequences for the generation
  • tools (array): Array of tool definitions for function calling
  • tool_choice (object): Controls which tools are called
  • thinking (object): Extended thinking configuration
  • system (string or array): System prompt
  • 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
    }
}