← Back to Marketplace

Anthropic

API Key

Claude. The AI assistant built for safety, depth, and precision.

https://api.anthropic.com
OVERVIEW

Anthropic's Messages API provides access to the Claude family of models. Claude Opus 4 for complex reasoning, Claude Sonnet 4 for the best balance of speed and intelligence, and Claude Haiku for fast, lightweight tasks. Claude excels at long-context analysis (up to 200K tokens), structured tool use, and nuanced instruction following.

The API uses a custom header for authentication (x-api-key) and requires a version header. Responses can be streamed via Server-Sent Events. The tool use system allows Claude to call external functions and return structured data.

GET YOUR API KEY

Authentication setup

  1. Go to console.anthropic.com and sign in
  2. Navigate to API Keys
  3. Click Create Key
  4. Copy the key. It starts with sk-ant-api03-
Token format sk-ant-api03-...
Auth type api_key
Header x-api-key
Required header anthropic-version: 2023-06-01
QUICK CONNECT

Create a connection in one request.

CONNECT ANTHROPIC
POST /connections Authorization: Bearer $TOKEN Content-Type: application/json { "name": "Anthropic", "base_url": "https://api.anthropic.com", "auth_type": "api_key", "auth_config": {"key": "sk-ant-api03-...", "header": "x-api-key"}, "extra_headers": {"anthropic-version": "2023-06-01"} } → {"id": "cn_xxxxxxxx", "name": "Anthropic"}
KEY ENDPOINTS

What you can call via proxy.

MethodPathDescription
POST /v1/messages Create a message: Claude Opus, Sonnet, Haiku
POST /v1/messages (stream) Stream response tokens via SSE
GET /v1/models List available Claude models
POST /v1/messages/batches Submit a batch of message requests
GET /v1/messages/batches/{id} Check batch processing status
POST /v1/messages/count_tokens Count tokens before sending a request
EXAMPLE

Create Message

PROXY CALL
POST /proxy/cn_xxxxxxxx/v1/messages Authorization: Bearer $TOKEN Content-Type: application/json { "model": "claude-sonnet-4-20250514", "max_tokens": 256, "messages": [ {"role": "user", "content": "What is an API proxy?"} ] } { "id": "msg_01abc", "type": "message", "role": "assistant", "content": [{ "type": "text", "text": "An API proxy is a server that sits between your application and an upstream API..." }], "model": "claude-sonnet-4-20250514", "usage": {"input_tokens": 12, "output_tokens": 64} }
USE CASES

What people build with Anthropic.

AI Assistants

Build assistants with Claude's 200K context window for deep document analysis and conversation.

Code Generation

Generate, review, and refactor code across dozens of languages with high accuracy.

Tool Use Agents

Let Claude call your functions via structured tool use for agentic workflows.

Document Analysis

Summarize, extract, and analyze long documents.PDFs, reports, legal contracts.

# Anthropic > Claude. The AI assistant built for safety, depth, and precision. ## Overview Anthropic's Messages API provides access to the Claude family of models. Claude Opus 4 for complex reasoning, Claude Sonnet 4 for the best balance of speed and intelligence, and Claude Haiku for fast, lightweight tasks. Claude excels at long-context analysis (up to 200K tokens), structured tool use, and nuanced instruction following. The API uses a custom header for authentication (<code>x-api-key</code>) and requires a version header. Responses can be streamed via Server-Sent Events. The tool use system allows Claude to call external functions and return structured data. - **Base URL:** https://api.anthropic.com - **Auth type:** api_key - **Token format:** sk-ant-api03-... ## Get Your API Key 1. Go to console.anthropic.com and sign in 2. Navigate to API Keys 3. Click Create Key 4. Copy the key. It starts with sk-ant-api03- ## Quick Connect bashcurl -X POST https://api.liteio.dev/connections \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Anthropic", "base_url": "https://api.anthropic.com", "auth_type": "api_key", "auth_config": {"key": "sk-ant-api03-...", "header": "x-api-key"} }' ## Key Endpoints MethodPathDescription POST/v1/messagesCreate a message: Claude Opus, Sonnet, Haiku POST/v1/messages (stream)Stream response tokens via SSE GET/v1/modelsList available Claude models POST/v1/messages/batchesSubmit a batch of message requests GET/v1/messages/batches/{id}Check batch processing status POST/v1/messages/count_tokensCount tokens before sending a request ## Example: Create Message bashcurl -X POST https://api.liteio.dev/proxy/cn_xxx/v1/messages \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-20250514", "max_tokens": 256, "messages": [ {"role": "user", "content": "What is an API proxy?"} ] }' ## Use Cases - **AI Assistants**: Build assistants with Claude's 200K context window for deep document analysis and conversation. - **Code Generation**: Generate, review, and refactor code across dozens of languages with high accuracy. - **Tool Use Agents**: Let Claude call your functions via structured tool use for agentic workflows. - **Document Analysis**: Summarize, extract, and analyze long documents.PDFs, reports, legal contracts. ## Links - Back to Marketplace - Developer Guide - Get API Key