Skip to main content

Overview

LemonData API is designed for drop-in compatibility with all major AI development tools. This guide documents supported parameters and verified integrations.
All parameters are validated but passed through to upstream providers. Unsupported parameters for specific models are silently ignored, ensuring maximum compatibility.

Supported API Formats

EndpointFormatUse Case
/v1/chat/completionsOpenAI ChatUniversal compatibility
/v1/responsesOpenAI ResponsesStateful conversations
/v1/messagesAnthropic MessagesClaude native features
/v1beta/models/:model:generateContentGoogle GeminiGemini native features

IDE & CLI Compatibility

Verified Tools

ToolStatusFormatNotes
Cursor✅ FullOpenAIAnthropic tool format supported
Claude Code CLI✅ FullAnthropicExtended thinking, tool_choice
Windsurf✅ FullOpenAIStandard OpenAI format
Aider✅ FullOpenAIAll models supported
Continue.dev✅ FullOpenAI/AnthropicDual format support
OpenCode✅ FullOpenAIMulti-provider support
Cline/Roo Code✅ FullOpenAIVia OpenRouter format
GitHub Copilot✅ FullOpenAIStandard format
Codex CLI✅ FullOpenAIOpenAI Responses API
Gemini CLI✅ FullGeminiNative Gemini format

Configuration Examples

Base URL: https://api.lemondata.cc/v1
API Key: sk-your-lemondata-key
Cursor uses Anthropic-style tool format internally. LemonData supports both:
  • OpenAI format: { type: "function", function: { name, parameters } }
  • Anthropic format: { name, input_schema } (no type field)

SDK Compatibility

Verified SDKs

SDKLanguageStatusNotes
OpenAI SDKPython/JS/Go✅ FullAll parameters supported
Anthropic SDKPython/JS✅ FullExtended thinking, tools
Vercel AI SDKTypeScript✅ FullstreamText, generateObject
LangChainPython/JS✅ FullChatOpenAI, bind_tools
LlamaIndexPython✅ FullOpenAI-compatible
Dify-✅ FullOpenAI format

Chat Completions Parameters

Core Parameters

ParameterTypeDescription
modelstringModel identifier (required)
messagesarrayConversation messages (required)
max_tokensintegerMaximum output tokens
temperaturenumberSampling temperature (0-2)
top_pnumberNucleus sampling (0-1)
streambooleanEnable streaming

Tool Calling

{
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get weather for a location",
        "parameters": {
          "type": "object",
          "properties": {
            "location": { "type": "string" }
          }
        },
        "strict": true
      }
    }
  ],
  "tool_choice": "auto",
  "parallel_tool_calls": true
}

Tool Choice Options

FormatExampleDescription
String"auto", "none", "required"Simple selection
OpenAI Object{ "type": "function", "function": { "name": "fn" } }Force specific function
Anthropic Object{ "type": "tool", "name": "fn", "disable_parallel_tool_use": true }Anthropic native format

Advanced Parameters

ParameterTypeDescription
stream_optionsobject{ include_usage: true } for token counts
reasoning_effortstring"low", "medium", "high" for o1/o3 models
service_tierstring"auto" or "default"
seedintegerDeterministic outputs
logprobsbooleanReturn log probabilities
top_logprobsintegerNumber of top logprobs (0-20)
logit_biasobjectToken bias map (-100 to 100)
frequency_penaltynumberRepetition penalty (-2 to 2)
presence_penaltynumberTopic penalty (-2 to 2)
stopstring/arrayStop sequences
nintegerNumber of completions (1-128)
userstringUser identifier for tracking

OpenAI Advanced Features

ParameterTypeDescription
modalitiesarray["text", "audio"] for multimodal
audioobjectAudio output config (voice, format)
predictionobjectPredicted output for faster completion
metadataobjectKey-value pairs for tracking
storebooleanStore for later retrieval

Provider-Specific Options

{
  "anthropic_options": {
    "thinking": {
      "type": "enabled",
      "budget_tokens": 10000
    },
    "prompt_caching": true
  },
  "google_options": {
    "safety_settings": [...],
    "google_search": true,
    "code_execution": true
  }
}

Anthropic Messages Parameters

Core Parameters

ParameterTypeDescription
modelstringModel identifier
messagesarrayConversation messages
max_tokensintegerMaximum output (up to 128000)
systemstring/arraySystem prompt
streambooleanEnable streaming

Tool Calling

{
  "tools": [
    {
      "name": "get_weather",
      "description": "Get weather",
      "input_schema": {
        "type": "object",
        "properties": {
          "location": { "type": "string" }
        }
      }
    }
  ],
  "tool_choice": {
    "type": "auto",
    "disable_parallel_tool_use": false
  }
}

Extended Thinking

{
  "model": "claude-opus-4-5",
  "thinking": {
    "type": "enabled",
    "budget_tokens": 10000
  }
}

Responses API Parameters

Core Parameters

ParameterTypeDescription
modelstringModel identifier
inputstring/arrayInput content
instructionsstringSystem instructions
max_output_tokensintegerMaximum output tokens
previous_response_idstringContinue conversation

Advanced Parameters

ParameterTypeDescription
truncation_strategystring"auto" or "disabled"
includearray["reasoning.encrypted_content"]
reasoning_effortstringFor reasoning models
service_tierstringPriority tier

Tool Format

Supports both OpenAI and Anthropic tool formats:
// OpenAI format
{ "type": "function", "name": "fn", "parameters": {...} }

// Anthropic format (Cursor compatibility)
{ "name": "fn", "input_schema": {...} }

Gemini API Parameters

Core Parameters

ParameterTypeDescription
contentsarrayConversation content
systemInstructionobjectSystem prompt
generationConfigobjectGeneration settings

Tools

{
  "tools": [{
    "functionDeclarations": [{
      "name": "search",
      "description": "Search the web",
      "parameters": {...}
    }],
    "codeExecution": {},
    "googleSearch": {}
  }],
  "toolConfig": {
    "functionCallingConfig": {
      "mode": "AUTO"
    }
  }
}

Safety Settings

{
  "safetySettings": [
    {
      "category": "HARM_CATEGORY_HARASSMENT",
      "threshold": "BLOCK_MEDIUM_AND_ABOVE"
    }
  ]
}

Additional Parameters

ParameterTypeDescription
cachedContentstringCached content reference
responseMimeTypestring"text/plain" or "application/json"
responseSchemaobjectJSON schema for structured output

Streaming

All endpoints support Server-Sent Events (SSE) streaming:
# Chat Completions
curl https://api.lemondata.cc/v1/chat/completions \
  -H "Authorization: Bearer sk-xxx" \
  -d '{"model": "gpt-4o", "messages": [...], "stream": true}'

# With usage tracking
-d '{"...", "stream_options": {"include_usage": true}}'

Error Handling

LemonData returns OpenAI-compatible error responses:
{
  "error": {
    "message": "Invalid API key",
    "type": "invalid_api_key",
    "code": "invalid_api_key"
  }
}
See Error Handling Guide for details.

Best Practices

All schemas use .passthrough() - unknown parameters are forwarded to upstream providers.
Enable stream_options.include_usage for accurate token counts in streaming responses.
Match your SDK’s expected format. LemonData accepts both OpenAI and Anthropic formats.