Skip to main content

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

https://api.lemondata.cc

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

EndpointMethodDescription
/v1/chat/completionsPOSTOpenAI-compatible chat completions
/v1/messagesPOSTAnthropic-compatible messages API
/v1/responsesPOSTOpenAI Responses API

Embeddings & Rerank

EndpointMethodDescription
/v1/embeddingsPOSTCreate text embeddings
/v1/rerankPOSTRerank documents

Images

EndpointMethodDescription
/v1/images/generationsPOSTGenerate images from text
/v1/images/editsPOSTEdit images

Audio

EndpointMethodDescription
/v1/audio/speechPOSTText-to-speech (TTS)
/v1/audio/transcriptionsPOSTSpeech-to-text (STT)

Video

EndpointMethodDescription
/v1/videos/generationsPOSTCreate video generation task
/v1/videos/generations/{id}GETGet video task status

Async Tasks

EndpointMethodDescription
/v1/tasks/{taskId}GETUnified async task status endpoint. Recommended when following a returned poll_url

Music

EndpointMethodDescription
/v1/music/generationsPOSTCreate music generation task
/v1/music/generations/{id}GETGet music task status

3D Generation

EndpointMethodDescription
/v1/3d/generationsPOSTCreate 3D model generation task
/v1/3d/generations/{id}GETGet 3D task status

Models

EndpointMethodDescription
/v1/modelsGETList all available models
/v1/models/{model}GETGet specific model info

Gemini (v1beta)

Native Google Gemini API format support:
EndpointMethodDescription
/v1beta/models/{model}:generateContentPOSTGenerate content (Gemini format)
/v1beta/models/{model}:streamGenerateContentPOSTStream generate content (Gemini format)
Gemini endpoints support ?key= query parameter authentication in addition to standard Bearer token.

Response Format

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
  }
}
FieldDescription
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:
RoleRequests/min
User60
Partner300
VIP1,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