Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api-reference/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ will also fail.
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"model": "openai/gpt-4o",
"model": "openai/gpt-5.2",
"messages": [{"role": "user", "content": "Hello"}]
}'
```
Expand All @@ -44,7 +44,7 @@ will also fail.
-u '<token>:' \
-H 'Content-Type: application/json' \
-d '{
"model": "openai/gpt-4o",
"model": "openai/gpt-5.2",
"messages": [{"role": "user", "content": "Hello"}]
}'
# The colon prevents curl from asking for a password.
Expand Down
4 changes: 2 additions & 2 deletions api-reference/errors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Below is a summary of the HTTP status codes that Edgee API uses.
{
"error": {
"code": "provider_not_supported",
"message": "Provider 'anthropic' is not supported for model 'openai/gpt-4o'"
"message": "Provider 'anthropic' is not supported for model 'openai/gpt-5.2'"
}
}
```
Expand Down Expand Up @@ -162,7 +162,7 @@ Below is a summary of the HTTP status codes that Edgee API uses.
{
"error": {
"code": "forbidden",
"message": "Model 'openai/gpt-4o' is not allowed for this API key"
"message": "Model 'openai/gpt-5.2' is not allowed for this API key"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion api-reference/messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ See the [Authentication](/api-reference/authentication) page for more details.
<ParamField body="model" type="string" required>
The model ID to use. Use Anthropic model names without provider prefix.

Examples: `claude-sonnet-4.5`, `claude-opus-4`, `claude-haiku-4`
Examples: `claude-sonnet-4-6`, `claude-opus-4-6`, `claude-haiku-4-5`
</ParamField>

<ParamField body="max_tokens" type="integer" required>
Expand Down
28 changes: 14 additions & 14 deletions api-reference/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "openai/gpt-4o",
"model": "openai/gpt-5.2",
"choices": [
{
"index": 0,
Expand Down Expand Up @@ -114,13 +114,13 @@
},
"examples": {
"contentChunk": {
"value": "data: {\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1677652288,\"model\":\"openai/gpt-4o\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hello\"},\"finish_reason\":null}]}\n\n"
"value": "data: {\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1677652288,\"model\":\"openai/gpt-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hello\"},\"finish_reason\":null}]}\n\n"
},
"roleChunk": {
"value": "data: {\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1677652288,\"model\":\"openai/gpt-4o\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\n"
"value": "data: {\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1677652288,\"model\":\"openai/gpt-5.2\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\n"
},
"finalChunk": {
"value": "data: {\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1677652288,\"model\":\"openai/gpt-4o\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":10,\"completion_tokens\":10,\"total_tokens\":20,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}}}\n\n"
"value": "data: {\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1677652288,\"model\":\"openai/gpt-5.2\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":10,\"completion_tokens\":10,\"total_tokens\":20,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}}}\n\n"
}
}
}
Expand Down Expand Up @@ -154,7 +154,7 @@
"value": {
"error": {
"code": "provider_not_supported",
"message": "Provider 'anthropic' is not supported for model 'openai/gpt-4o'"
"message": "Provider 'anthropic' is not supported for model 'openai/gpt-5.2'"
}
}
}
Expand Down Expand Up @@ -206,7 +206,7 @@
"value": {
"error": {
"code": "forbidden",
"message": "Model 'openai/gpt-4o' is not allowed for this API key"
"message": "Model 'openai/gpt-5.2' is not allowed for this API key"
}
}
}
Expand Down Expand Up @@ -351,13 +351,13 @@
"object": "list",
"data": [
{
"id": "openai/gpt-4o",
"id": "openai/gpt-5.2",
"object": "model",
"created": 1677610602,
"owned_by": "openai"
},
{
"id": "anthropic/claude-3-opus",
"id": "anthropic/claude-opus-4-6",
"object": "model",
"created": 1677610602,
"owned_by": "anthropic"
Expand Down Expand Up @@ -492,7 +492,7 @@
"model": {
"type": "string",
"description": "Optional model hint to improve tokenizer selection. When provided, the gateway uses this to choose the most appropriate tokenizer for the target model.",
"example": "openai/gpt-4o"
"example": "openai/gpt-5.2"
}
}
},
Expand All @@ -519,8 +519,8 @@
"properties": {
"model": {
"type": "string",
"description": "ID of the model to use. Format: `{author_id}/{model_id}` (e.g. `openai/gpt-4o`)",
"example": "openai/gpt-4o"
"description": "ID of the model to use. Format: `{author_id}/{model_id}` (e.g. `openai/gpt-5.2`)",
"example": "openai/gpt-5.2"
},
"messages": {
"type": "array",
Expand Down Expand Up @@ -782,7 +782,7 @@
"model": {
"type": "string",
"description": "The model used for the chat completion.",
"example": "openai/gpt-4o"
"example": "openai/gpt-5.2"
},
"choices": {
"type": "array",
Expand Down Expand Up @@ -917,7 +917,7 @@
"id": {
"type": "string",
"description": "The model identifier, which can be referenced in the API. Format: `{author_id}/{model_id}`.",
"example": "openai/gpt-4o"
"example": "openai/gpt-5.2"
},
"object": {
"type": "string",
Expand Down Expand Up @@ -969,7 +969,7 @@
"model": {
"type": "string",
"description": "The model used for the chat completion.",
"example": "openai/gpt-4o"
"example": "openai/gpt-5.2"
},
"choices": {
"type": "array",
Expand Down
16 changes: 8 additions & 8 deletions features/automatic-model-selection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const response = await edgee.send({
max_latency_ms: 2000, // Must respond in under 2s
});

console.log(`Model used: ${response.model}`); // e.g., "gpt-4o"
console.log(`Model used: ${response.model}`); // e.g., "gpt-5.2"
console.log(`Latency: ${response.latency_ms}ms`);
```

Expand Down Expand Up @@ -93,12 +93,12 @@ When a provider fails, Edgee automatically retries with backup models:

```typescript
const response = await edgee.send({
model: 'gpt-4o',
fallback_models: ['claude-3.5-sonnet', 'gemini-pro'], // Backup chain
model: 'gpt-5.2',
fallback_models: ['claude-sonnet-4-6', 'gemini-pro'], // Backup chain
input: 'Your prompt here',
});

// If GPT-4o is unavailable, Edgee tries Claude 3.5, then Gemini
// If GPT-5.2 is unavailable, Edgee tries Claude 3.5, then Gemini
console.log(`Model used: ${response.model}`);
console.log(`Fallback used: ${response.fallback_used}`); // true/false
```
Expand Down Expand Up @@ -138,15 +138,15 @@ Configure default routing strategies per use case:
await edgee.routing.configure({
name: 'rag-qa',
strategy: 'cost',
allowed_models: ['gpt-5.2', 'gpt-5.1', 'claude-3.5-sonnet'],
allowed_models: ['gpt-5.2', 'gpt-5.1', 'claude-sonnet-4-6'],
quality_threshold: 0.9,
});

// Code generation: Optimize for performance
await edgee.routing.configure({
name: 'code-gen',
strategy: 'performance',
allowed_models: ['gpt-4o', 'claude-3.5-sonnet'],
allowed_models: ['gpt-5.2', 'claude-sonnet-4-6'],
quality_threshold: 0.95,
});

Expand All @@ -169,7 +169,7 @@ await edgee.routing.addRule({
token_count: { gt: 10000 }, // Requests over 10k tokens
},
action: {
models: ['claude-3.5-sonnet'], // Use Claude for long contexts
models: ['claude-sonnet-4-6'], // Use Claude for long contexts
strategy: 'cost',
},
});
Expand All @@ -180,7 +180,7 @@ await edgee.routing.addRule({
metadata: { priority: 'high' }, // High-priority requests
},
action: {
models: ['gpt-4o', 'claude-opus'], // Use premium models
models: ['gpt-5.2', 'claude-opus'], // Use premium models
strategy: 'performance',
},
});
Expand Down
14 changes: 7 additions & 7 deletions features/observability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Every Edgee response includes detailed token usage information for tracking and

```typescript
const response = await edgee.send({
model: 'gpt-4o',
model: 'gpt-5.2',
input: 'Your prompt here',
});

Expand All @@ -29,7 +29,7 @@ if (response.compression) {
```

**Track usage by:**
- Model (GPT-4o vs Claude vs Gemini)
- Model (GPT-5.2 vs Claude vs Gemini)
- Project or application
- Environment (production vs staging)
- User or tenant (for multi-tenant apps)
Expand All @@ -53,7 +53,7 @@ Tags allow you to categorize and label requests for filtering and grouping in yo
const edgee = new Edgee("your-api-key");

const response = await edgee.send({
model: 'gpt-4o',
model: 'gpt-5.2',
input: {
messages: [{ role: 'user', content: 'Hello!' }],
tags: ['production', 'chat-feature', 'user-123', 'team-backend']
Expand All @@ -69,7 +69,7 @@ Tags allow you to categorize and label requests for filtering and grouping in yo
edgee = Edgee("your-api-key")

response = edgee.send(
model="gpt-4o",
model="gpt-5.2",
input=InputObject(
messages=[Message(role="user", content="Hello!")],
tags=["production", "chat-feature", "user-123", "team-backend"]
Expand All @@ -84,7 +84,7 @@ Tags allow you to categorize and label requests for filtering and grouping in yo

client, _ := edgee.NewClient("your-api-key")

response, err := client.Send("gpt-4o", edgee.InputObject{
response, err := client.Send("gpt-5.2", edgee.InputObject{
Messages: []edgee.Message{
{Role: "user", Content: "Hello!"},
},
Expand All @@ -107,7 +107,7 @@ Tags allow you to categorize and label requests for filtering and grouping in yo
"team-backend".to_string(),
]);

let response = client.send("gpt-4o", input).await?;
let response = client.send("gpt-5.2", input).await?;
```
</Tab>
</Tabs>
Expand Down Expand Up @@ -184,7 +184,7 @@ See exactly how much token compression is saving you on every request:

```typescript
const response = await edgee.send({
model: 'gpt-4o',
model: 'gpt-5.2',
input: 'Long prompt with lots of context...',
enable_compression: true,
});
Expand Down
14 changes: 7 additions & 7 deletions features/token-compression.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Enable compression for specific requests using the SDK:
<Tab title="TypeScript">
```typescript
const response = await edgee.send({
model: 'gpt-4o',
model: 'gpt-5.2',
input: {
"messages": [
{"role": "user", "content": "Your prompt here"}
Expand All @@ -93,7 +93,7 @@ Enable compression for specific requests using the SDK:
<Tab title="Python">
```python
response = edgee.send(
model="gpt-4o",
model="gpt-5.2",
input={
"messages": [
{"role": "user", "content": "Your prompt here"}
Expand All @@ -107,7 +107,7 @@ Enable compression for specific requests using the SDK:

<Tab title="Go">
```go
response, err := client.Send("gpt-4o", edgee.InputObject{
response, err := client.Send("gpt-5.2", edgee.InputObject{
Messages: []edgee.Message{
{Role: "user", Content: "Your prompt here"},
},
Expand All @@ -123,7 +123,7 @@ Enable compression for specific requests using the SDK:
.with_compression(true)
.with_compression_rate(0.8); // Target ratio: compressed = 80% of original (optional)

let response = client.send("gpt-4o", input).await?;
let response = client.send("gpt-5.2", input).await?;
```
</Tab>
</Tabs>
Expand Down Expand Up @@ -215,7 +215,7 @@ const documents = [
];

const response = await edgee.send({
model: 'gpt-4o',
model: 'gpt-5.2',
input: `Answer the question based on these documents:\n\n${documents.join('\n\n')}\n\nQuestion: What is the main topic?`,
enable_compression: true, // Enable compression for this request
compression_rate: 0.8, // Target ratio (0-1): 0.8 = compressed is 80% of original
Expand Down Expand Up @@ -246,10 +246,10 @@ Here's what token compression means for your monthly AI bill:

| Use Case | Monthly Requests | Without Edgee | With Edgee (50% compression) | **Monthly Savings** |
|----------|-----------------|---------------|------------------------------|---------------------|
| RAG Q&A (GPT-4o) | 100,000 @ 2,000 tokens | $3,000 | $1,500 | **$1,500** |
| RAG Q&A (GPT-5.2) | 100,000 @ 2,000 tokens | $3,000 | $1,500 | **$1,500** |
| Document Analysis (Claude 3.5) | 50,000 @ 4,000 tokens | $1,800 | $900 | **$900** |
| Chatbot (GPT-4o-mini) | 500,000 @ 500 tokens | $375 | $188 | **$187** |
| Multi-turn Agent (GPT-4o) | 200,000 @ 1,000 tokens | $3,000 | $1,500 | **$1,500** |
| Multi-turn Agent (GPT-5.2) | 200,000 @ 1,000 tokens | $3,000 | $1,500 | **$1,500** |

<Note>
Savings calculations use list pricing for GPT-4o ($5/1M input tokens), Claude 3.5 Sonnet ($3/1M input tokens), and GPT-4o-mini ($0.15/1M input tokens). Actual compression ratios vary by use case.
Expand Down
4 changes: 2 additions & 2 deletions integrations/anthropic-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ With Edgee, you can access models from multiple providers using the same Anthrop

# Use GPT-4 through the same client
gpt_response = client.messages.create(
model="gpt-4o",
model="gpt-5.2",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}]
)
Expand Down Expand Up @@ -345,7 +345,7 @@ With Edgee, you can access models from multiple providers using the same Anthrop

// Use GPT-4 through the same client
const gptResponse = await client.messages.create({
model: 'gpt-4o',
model: 'gpt-5.2',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello!' }]
});
Expand Down
2 changes: 1 addition & 1 deletion integrations/claude-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ When using Edgee with Claude Code, you can specify which Claude model to use thr
claude --model claude-sonnet-4.5 "Explain this codebase"

# Use different providers through Edgee
claude --model gpt-4o "Refactor this function"
claude --model gpt-5.2 "Refactor this function"
```

## Advanced Configuration
Expand Down
2 changes: 1 addition & 1 deletion integrations/langchain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ import os
llm = ChatOpenAI(
base_url="https://api.edgee.ai/v1",
api_key=os.getenv("API_KEY"),
model="gpt-4o",
model="gpt-5.2",
default_headers={
"x-edgee-enable-compression": "true",
"x-edgee-compression-rate": "0.8", # Target 80% compression
Expand Down
Loading