Skip to main content
Sunra provides three LLM API endpoints, each following a different format. All three use the same authentication and base URL (https://api-llm.sunra.ai), so you can pick whichever format fits your stack. Before diving in, grab an API key from your dashboard.

Chat Completions — /v1/chat/completions

The Chat Completions endpoint follows the OpenAI Chat Completions format. It accepts a list of messages with roles (system, user, assistant) and returns a completion. Use this endpoint when you want drop-in compatibility with OpenAI SDKs and tooling. Key features: streaming, function calling, vision (images, audio, video, files), reasoning, structured outputs (JSON schema / grammar), logprobs.
curl -X POST https://api-llm.sunra.ai/v1/chat/completions \
  -H "Authorization: Bearer <SUNRA_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o",
    "messages": [
      { "role": "system", "content": "You are a helpful assistant." },
      { "role": "user", "content": "What is the capital of France?" }
    ]
  }'

Anthropic Messages — /v1/messages

The Anthropic Messages endpoint follows the Anthropic Messages API format. It uses user / assistant message roles with rich content blocks and a separate system parameter. Use this endpoint when you want native access to Anthropic Claude models and features like extended thinking, prompt caching, citations, and built-in tools (web search, code execution). Key features: streaming, extended thinking, prompt caching, tool use (custom + built-in), PDF/document input, citations, structured outputs.
curl -X POST https://api-llm.sunra.ai/v1/messages \
  -H "Authorization: Bearer <SUNRA_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-4-20250514",
    "max_tokens": 1024,
    "messages": [
      { "role": "user", "content": "Hello, how are you?" }
    ]
  }'

Responses — /v1/responses

The Responses endpoint follows the OpenAI Responses API format. It accepts flexible input items (messages, function calls, reasoning) and returns structured output items. Use this endpoint when you need the latest OpenAI Responses features like built-in web search, file search, code interpreter, computer use, MCP tool integration, or image generation. Key features: streaming, function calling, web search, file search, code interpreter, computer use, MCP tools, image generation, reasoning, structured outputs.
curl -X POST https://api-llm.sunra.ai/v1/responses \
  -H "Authorization: Bearer <SUNRA_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o",
    "input": [
      { "type": "message", "role": "user", "content": "Hello, how are you?" }
    ]
  }'

Choosing the right endpoint

Chat CompletionsAnthropic MessagesResponses
FormatOpenAI ChatAnthropic MessagesOpenAI Responses
Best forOpenAI SDK compatibilityClaude-native featuresLatest OpenAI features
StreamingSSESSESSE
Function callingYesYes (custom + built-in)Yes
ReasoningYesExtended thinkingYes
Structured outputJSON schema, grammarJSON schemaJSON schema
Built-in toolsWeb search, code executionWeb search, file search, code interpreter, computer use, MCP
All three endpoints share the same authentication — just pass your API key as a Bearer token in the Authorization header.