Migrating from Anthropic
Move an Anthropic-based application to The Grid. Keep the Anthropic SDK against our Messages API beta, or swap to the OpenAI SDK against the Consumption API.
Pick Path 1 to keep your SDK, Path 2 for long-term stability
Situation
Path
Path 1: Anthropic Messages API beta
from anthropic import Anthropic
client = Anthropic(
base_url="https://messages-beta.api.thegrid.ai/v1", # was: https://api.anthropic.com
api_key="your-grid-api-key", # from app.thegrid.ai/profile/api-keys
)
response = client.messages.create(
model="text-prime", # was: claude-sonnet-4-6
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://messages-beta.api.thegrid.ai/v1",
apiKey: "your-grid-api-key",
});
const response = await client.messages.create({
model: "text-prime",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello" }],
});Path 1 capabilities
Path 1 limitations
Path 2: OpenAI SDK against the Consumption API
Path 2 differences
Model mapping
General text and reasoning
What you use today
Recommended Grid instrument
Typical use cases
Code generation (preview)
What you use today
Recommended Grid instrument
Typical use cases
Agent tool calling (preview)
What you use today
Recommended Grid instrument
Typical use cases
Five differences from Anthropic that apply to both paths
After the switch, route honestly and handle retries
Last updated
Was this helpful?