diff --git a/integrations/anthropic-sdk.mdx b/integrations/anthropic-sdk.mdx index bc2e879..7500ab3 100644 --- a/integrations/anthropic-sdk.mdx +++ b/integrations/anthropic-sdk.mdx @@ -31,7 +31,7 @@ The Anthropic SDK provides official Python and TypeScript clients for interactin # Initialize client with Edgee endpoint client = Anthropic( - base_url="https://api.edgee.ai/v1", + base_url="https://api.edgee.ai", api_key=os.environ.get("EDGEE_API_KEY"), ) @@ -55,7 +55,7 @@ The Anthropic SDK provides official Python and TypeScript clients for interactin // Initialize client with Edgee endpoint const client = new Anthropic({ - baseURL: 'https://api.edgee.ai/v1', + baseURL: 'https://api.edgee.ai', apiKey: process.env.EDGEE_API_KEY, }); @@ -84,7 +84,7 @@ Stream responses for real-time token delivery: from anthropic import Anthropic client = Anthropic( - base_url="https://api.edgee.ai/v1", + base_url="https://api.edgee.ai", api_key=os.environ.get("EDGEE_API_KEY"), ) @@ -106,7 +106,7 @@ Stream responses for real-time token delivery: import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic({ - baseURL: 'https://api.edgee.ai/v1', + baseURL: 'https://api.edgee.ai', apiKey: process.env.EDGEE_API_KEY, }); @@ -140,7 +140,7 @@ With Edgee, you can access models from multiple providers using the same Anthrop from anthropic import Anthropic client = Anthropic( - base_url="https://api.edgee.ai/v1", + base_url="https://api.edgee.ai", api_key=os.environ.get("EDGEE_API_KEY"), ) @@ -172,7 +172,7 @@ With Edgee, you can access models from multiple providers using the same Anthrop import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic({ - baseURL: 'https://api.edgee.ai/v1', + baseURL: 'https://api.edgee.ai/', apiKey: process.env.EDGEE_API_KEY, }); @@ -210,7 +210,7 @@ Use Claude's tool calling with Edgee: from anthropic import Anthropic client = Anthropic( - base_url="https://api.edgee.ai/v1", + base_url="https://api.edgee.ai", api_key=os.environ.get("EDGEE_API_KEY"), ) @@ -251,7 +251,7 @@ Use Claude's tool calling with Edgee: import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic({ - baseURL: 'https://api.edgee.ai/v1', + baseURL: 'https://api.edgee.ai', apiKey: process.env.EDGEE_API_KEY, }); @@ -298,7 +298,7 @@ Add custom tags to track and filter requests in Edgee's dashboard: from anthropic import Anthropic client = Anthropic( - base_url="https://api.edgee.ai/v1", + base_url="https://api.edgee.ai", api_key=os.environ.get("EDGEE_API_KEY"), default_headers={ "x-edgee-tags": "production,anthropic-sdk,user-123" @@ -319,7 +319,7 @@ Add custom tags to track and filter requests in Edgee's dashboard: import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic({ - baseURL: 'https://api.edgee.ai/v1', + baseURL: 'https://api.edgee.ai', apiKey: process.env.EDGEE_API_KEY, defaultHeaders: { 'x-edgee-tags': 'production,anthropic-sdk,user-123' @@ -350,7 +350,7 @@ The Anthropic SDK includes built-in retry logic, which works seamlessly with Edg from anthropic import Anthropic, APIError client = Anthropic( - base_url="https://api.edgee.ai/v1", + base_url="https://api.edgee.ai", api_key=os.environ.get("EDGEE_API_KEY"), max_retries=3, # SDK will retry up to 3 times ) @@ -372,7 +372,7 @@ The Anthropic SDK includes built-in retry logic, which works seamlessly with Edg import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic({ - baseURL: 'https://api.edgee.ai/v1', + baseURL: 'https://api.edgee.ai', apiKey: process.env.EDGEE_API_KEY, maxRetries: 3, // SDK will retry up to 3 times }); @@ -444,7 +444,7 @@ Here's a complete application example: def main(): # Initialize client client = Anthropic( - base_url="https://api.edgee.ai/v1", + base_url="https://api.edgee.ai", api_key=os.environ.get("EDGEE_API_KEY"), default_headers={ "x-edgee-tags": "production,chat-app" @@ -495,7 +495,7 @@ Here's a complete application example: async function main() { // Initialize client const client = new Anthropic({ - baseURL: 'https://api.edgee.ai/v1', + baseURL: 'https://api.edgee.ai', apiKey: process.env.EDGEE_API_KEY, defaultHeaders: { 'x-edgee-tags': 'production,chat-app' diff --git a/integrations/claude-code.mdx b/integrations/claude-code.mdx index 62f37c8..d50dca1 100644 --- a/integrations/claude-code.mdx +++ b/integrations/claude-code.mdx @@ -15,7 +15,7 @@ Claude Code supports custom API endpoints through its settings. You can configur Set the following environment variables in your shell configuration (`~/.bashrc`, `~/.zshrc`, etc.): ```bash -export ANTHROPIC_BASE_URL="https://api.edgee.ai/v1" +export ANTHROPIC_BASE_URL="https://api.edgee.ai" export ANTHROPIC_API_KEY="sk-edgee-..." ``` @@ -31,7 +31,7 @@ You can also configure Claude Code through its settings file. Create or edit `~/ ```json { - "apiEndpoint": "https://api.edgee.ai/v1", + "apiEndpoint": "https://api.edgee.ai", "apiKey": "sk-edgee-..." } ``` @@ -83,7 +83,7 @@ Tags help you categorize and filter requests in Edgee's analytics dashboard: ```json { - "apiEndpoint": "https://api.edgee.ai/v1", + "apiEndpoint": "https://api.edgee.ai", "apiKey": "sk-edgee-...", "customHeaders": { "x-edgee-tags": "production,claude-code,user-123" @@ -144,7 +144,7 @@ To get your API key: If Claude Code cannot connect to Edgee: 1. Verify your API key is correct -2. Check that the base URL is set to `https://api.edgee.ai/v1` +2. Check that the base URL is set to `https://api.edgee.ai` 3. Ensure you have internet connectivity 4. Check [Edgee's status page](https://status.edgee.cloud) @@ -154,7 +154,7 @@ If you receive authentication errors: ```bash # Test your API key with curl -curl https://api.edgee.ai/v1/chat/completions \ +curl https://api.edgee.ai/chat/completions \ -H "Authorization: Bearer $ANTHROPIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{ @@ -171,7 +171,7 @@ Here's a complete workflow for setting up Claude Code with Edgee: ```bash # 1. Set environment variables -export ANTHROPIC_BASE_URL="https://api.edgee.ai/v1" +export ANTHROPIC_BASE_URL="https://api.edgee.ai" export ANTHROPIC_API_KEY="sk-edgee-..." # 2. Test the connection