Plurence is currently in Public Beta. Features and pricing may change. Not recommended for production workloads. Beta Terms

Integration Guides

Anthropic Claude

Access all Claude models through Plurence using either the OpenAI-compatible interface or the native Anthropic SDK.

Option A — OpenAI SDK (recommended)

The simplest path. Use the OpenAI SDK pointed at Plurence, and specify a Claude model name. No Anthropic SDK needed.

python
from openai import OpenAI

client = OpenAI(
    api_key="plr_live_...",
    base_url="https://gateway.plurence.com/v1",
)

response = client.chat.completions.create(
    model="claude-3-5-sonnet-20241022",
    messages=[{"role": "user", "content": "Explain recursion."}],
    max_tokens=1024,
)
print(response.choices[0].message.content)

Option B — Anthropic SDK

If your code uses Anthropic-specific features (extended thinking, vision, tool use with Anthropic types), you can use the native Anthropic SDK and override the base URL:

python
import anthropic

client = anthropic.Anthropic(
    api_key="plr_live_...",
    base_url="https://gateway.plurence.com",
)

message = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content)
info

Note: native Anthropic SDK routing is in beta. For production, Option A (OpenAI SDK) is the most stable path.

Available Claude models

Model Context Best for
claude-3-5-sonnet-20241022 200K Balanced performance and speed
claude-3-5-haiku-20241022 200K Fast, cost-efficient tasks
claude-3-opus-20240229 200K Most capable, complex reasoning

Related