Overview
The LemonData API is OpenAI-compatible , which means you can use the official OpenAI SDK with just a base URL change. We also support native Anthropic and Gemini request formats.
Base URL
Authentication
All API endpoints require authentication using a Bearer token:
Authorization: Bearer sk-your-api-key
Get your API key from the Dashboard .
About the Interactive Playground : The playground on this documentation site is for demonstration purposes only and does not support entering API keys. To test the API, please use:
cURL - Copy the example commands and replace sk-your-api-key with your actual key
Postman - Import our OpenAPI spec
SDK - Use OpenAI/Anthropic SDK with our base URL
Supported Endpoints
Chat & Text Generation
Endpoint Method Description /v1/chat/completionsPOST OpenAI-compatible chat completions /v1/messagesPOST Anthropic-compatible messages API /v1/responsesPOST OpenAI Responses API
Embeddings & Rerank
Endpoint Method Description /v1/embeddingsPOST Create text embeddings /v1/rerankPOST Rerank documents
Images
Endpoint Method Description /v1/images/generationsPOST Generate images from text /v1/images/editsPOST Edit images
Audio
Endpoint Method Description /v1/audio/speechPOST Text-to-speech (TTS) /v1/audio/transcriptionsPOST Speech-to-text (STT)
Video
Endpoint Method Description /v1/videos/generationsPOST Create video generation task /v1/videos/generations/{id}GET Get video task status
Async Tasks
Endpoint Method Description /v1/tasks/{taskId}GET Unified async task status endpoint. Recommended when following a returned poll_url
Music
Endpoint Method Description /v1/music/generationsPOST Create music generation task /v1/music/generations/{id}GET Get music task status
3D Generation
Endpoint Method Description /v1/3d/generationsPOST Create 3D model generation task /v1/3d/generations/{id}GET Get 3D task status
Models
Endpoint Method Description /v1/modelsGET List all available models /v1/models/{model}GET Get specific model info
Gemini (v1beta)
Native Google Gemini API format support:
Endpoint Method Description /v1beta/models/{model}:generateContentPOST Generate content (Gemini format) /v1beta/models/{model}:streamGenerateContentPOST Stream generate content (Gemini format)
Gemini endpoints support ?key= query parameter authentication in addition to standard Bearer token.
All responses follow a consistent format:
Success Response
{
"id" : "chatcmpl-abc123" ,
"object" : "chat.completion" ,
"created" : 1234567890 ,
"model" : "gpt-4o" ,
"choices" : [ ... ],
"usage" : {
"prompt_tokens" : 10 ,
"completion_tokens" : 20 ,
"total_tokens" : 30
}
}
Routing Transparency
All responses include a _routing field with channel information:
{
"id" : "chatcmpl-abc123" ,
...,
"_routing" : {
"channel" : {
"id" : "ch_xxx" ,
"name" : "channel-name" ,
"provider" : "openai" ,
"channelType" : "PLATFORM"
},
"cached" : false ,
"retryCount" : 0
}
}
Field Description channel.idChannel identifier used channel.providerUpstream provider (openai, anthropic, etc.) channel.channelTypePLATFORM (LemonData) or PRIVATE (BYOK)cachedWhether response was served from cache retryCountNumber of retry attempts (if any)
Error Response
{
"error" : {
"message" : "Invalid API key provided" ,
"type" : "invalid_api_key" ,
"code" : "invalid_api_key"
}
}
Rate Limits
Rate limits are role-based and configurable by administrators. Default values:
Role Requests/min User 60 Partner 300 VIP 1,000
Contact support for custom rate limits. Exact values may vary by account configuration.
When rate limits are exceeded, the API returns a 429 status code with a Retry-After header indicating how long to wait.
OpenAPI Specification
OpenAPI Spec Download the complete OpenAPI 3.0 specification