메인 콘텐츠로 건너뛰기
Sunra는 각각 다른 형식을 따르는 세 가지 LLM API 엔드포인트를 제공합니다. 세 가지 모두 동일한 인증 방식과 base URL(https://api-llm.sunra.ai)을 사용하므로, 여러분의 스택에 맞는 형식을 선택하면 됩니다. 시작하기 전에 대시보드에서 API 키를 발급받으세요.

Chat Completions — /v1/chat/completions

Chat Completions 엔드포인트는 OpenAI Chat Completions 형식을 따릅니다. 역할(system, user, assistant)이 포함된 메시지 목록을 받아 completion을 반환합니다. OpenAI SDK 및 도구와의 즉시 호환성이 필요할 때 이 엔드포인트를 사용하세요. 주요 기능: streaming, function calling, vision (이미지, 오디오, 비디오, 파일), 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

Anthropic Messages 엔드포인트는 Anthropic Messages API 형식을 따릅니다. 리치 콘텐츠 블록과 별도의 system 매개변수를 사용하는 user / assistant 메시지 역할을 사용합니다. Anthropic Claude 모델에 대한 네이티브 접근과 extended thinking, prompt caching, citations, built-in tools (web search, code execution) 같은 기능이 필요할 때 이 엔드포인트를 사용하세요. 주요 기능: streaming, extended thinking, prompt caching, tool use (custom + built-in), PDF/문서 입력, 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

Responses 엔드포인트는 OpenAI Responses API 형식을 따릅니다. 유연한 input items (메시지, function calls, reasoning)를 받아 structured output items를 반환합니다. built-in web search, file search, code interpreter, computer use, MCP tools 통합, image generation 같은 최신 OpenAI Responses 기능이 필요할 때 이 엔드포인트를 사용하세요. 주요 기능: 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?" }
    ]
  }'

적합한 엔드포인트 선택하기

Chat CompletionsAnthropic MessagesResponses
형식OpenAI ChatAnthropic MessagesOpenAI Responses
적합한 용도OpenAI SDK 호환성Claude 네이티브 기능최신 OpenAI 기능
StreamingSSESSESSE
Function calling예 (custom + built-in)
ReasoningExtended thinking
Structured outputJSON schema, grammarJSON schemaJSON schema
Built-in toolsWeb search, code executionWeb search, file search, code interpreter, computer use, MCP
세 가지 엔드포인트 모두 동일한 인증 방식을 사용합니다 — Authorization 헤더에 API 키를 Bearer 토큰으로 전달하기만 하면 됩니다.