Overview
This endpoint provides native Anthropic Messages API compatibility. Use this for Claude models with features like extended thinking.Base URL for Anthropic SDK:
https://api.lemondata.cc (no /v1 suffix)Request Headers
Your LemonData API key. Alternative to Bearer token.
Anthropic API version. Use
2023-06-01.Request Body
Claude model ID (e.g.,
claude-sonnet-4-6 or claude-opus-4-6).Array of message objects with
role and content.For Claude models with vision support, content can be either a plain string or an array of content blocks. To send images, use structured content blocks rather than placing image URLs or Base64 strings directly into plain text.Example content blocks:- text block:
{ "type": "text", "text": "Describe this image" } - image block via URL:
{ "type": "image", "source": { "type": "url", "url": "https://example.com/image.jpg" } } - image block via Base64:
{ "type": "image", "source": { "type": "base64", "media_type": "image/png", "data": "iVBORw0KGgoAAA..." } }
Maximum tokens to generate.
System prompt (separate from messages array).
Sampling temperature (0-1).
Enable streaming responses.
Extended thinking configuration (Claude Opus 4.5).
type(string):"enabled"to enablebudget_tokens(integer): Token budget for thinking
Available tools for the model.
How the model should use tools. Options:
auto, any, tool (specific tool).Nucleus sampling parameter. Use either temperature or top_p, not both.
Only sample from the top K options for each token.
Custom stop sequences that will cause the model to stop generating.
Metadata to attach to the request for tracking purposes.
Response
Unique message identifier.
Always
message.Always
assistant.Array of content blocks (text, thinking, tool_use).
Model used.
Why generation stopped (
end_turn, max_tokens, tool_use).Token usage with
input_tokens and output_tokens.Vision Input Example
For Claude models with vision support, place images insidemessages[].content as structured image blocks.
Extended Thinking Example
Anthropic Message Batches
LemonData now exposes the native Anthropic Message Batches flow alongside/v1/messages.
Available routes:
POST /v1/messages/batchesGET /v1/messages/batchesGET /v1/messages/batches/:message_batch_idGET /v1/messages/batches/:message_batch_id/resultsPOST /v1/messages/batches/:message_batch_id/cancelDELETE /v1/messages/batches/:message_batch_id
- Use the same LemonData API key plus Anthropic-native headers.
- If batch items reference
file_id, also includeanthropic-beta: files-api-2025-04-14. - Batch jobs keep Anthropic-native request/response shapes while LemonData tracks their internal settlement lifecycle.