Skip to main content

Overview

LemonData is easiest to integrate through:
  • official OpenAI SDKs for OpenAI-compatible and Responses-style usage
  • official Anthropic SDKs for Claude-native /v1/messages
  • official Gemini / Google AI tooling when you specifically need Gemini-native request shapes

OpenAI Python

pip install openai

OpenAI Node

npm install openai

OpenAI Go

go get github.com/openai/openai-go/v3

Anthropic SDK

Native Claude Messages API support

OpenAI SDK Example

Use this as the default starting point for new projects:
from openai import OpenAI

client = OpenAI(
    api_key="sk-your-api-key",
    base_url="https://api.lemondata.cc/v1"
)

response = client.responses.create(
    model="gpt-5.4",
    input="Explain LemonData in one sentence."
)

print(response.output_text)

OpenAI Go Example

package main

import (
    openai "github.com/openai/openai-go/v3"
    "github.com/openai/openai-go/v3/option"
)

func main() {
    client := openai.NewClient(
        option.WithAPIKey("sk-your-api-key"),
        option.WithBaseURL("https://api.lemondata.cc/v1"),
    )

    _ = client
}

Anthropic SDK Example

from anthropic import Anthropic

client = Anthropic(
    api_key="sk-your-api-key",
    base_url="https://api.lemondata.cc"
)

message = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}]
)

Which SDK Should You Use?

GoalRecommended SDK
New app, general defaultOpenAI SDK
Claude-native featuresAnthropic SDK
Gemini-native request shapesGemini-native API / SDK
LangChain / LlamaIndex / Vercel AI SDKUse the dedicated integration pages

Best Practices

If your SDK supports both responses and chat.completions, start with responses.
Pass LemonData base URLs directly in your client configuration instead of relying on older environment-variable aliases.
Use the Anthropic SDK for Claude-native features such as extended thinking, and otherwise prefer the OpenAI SDK for broad compatibility.