diff --git a/api-reference/openapi.json b/api-reference/openapi.json
index 269d3dd..8cab3da 100644
--- a/api-reference/openapi.json
+++ b/api-reference/openapi.json
@@ -323,6 +323,13 @@
}
],
"description": "Controls which tool is called by the model."
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Optional tags to categorize and label the request. Useful for filtering and grouping requests in analytics and logs. Can also be sent via the `x-edgee-tags` header as a comma-separated string."
}
}
},
diff --git a/integrations/langchain.mdx b/integrations/langchain.mdx
index ab5bf94..728edf8 100644
--- a/integrations/langchain.mdx
+++ b/integrations/langchain.mdx
@@ -156,6 +156,31 @@ for chunk in llm.stream("Tell me a long story"):
print(chunk.content, end="", flush=True)
```
+### Tags
+
+You can add tags to your requests for analytics and filtering using the `default_headers` parameter:
+
+```python
+from langchain_openai import ChatOpenAI
+import os
+
+llm = ChatOpenAI(
+ base_url="https://api.edgee.ai/v1",
+ api_key=os.getenv("API_KEY"),
+ model="mistral-small",
+ default_headers={
+ "x-edgee-tags": "production,user-123,langchain",
+ },
+)
+
+# All requests from this client will include these tags
+response = llm.invoke("What is LangChain?")
+```
+
+
+ Tags are comma-separated strings in the header. They help you categorize and filter requests in Edgee's analytics dashboard.
+
+
## Authentication
Edgee uses standard Bearer token authentication. Set your API key as an environment variable:
diff --git a/sdk/go/send.mdx b/sdk/go/send.mdx
index 279ba2d..ea3198a 100644
--- a/sdk/go/send.mdx
+++ b/sdk/go/send.mdx
@@ -42,6 +42,7 @@ When `input` is an `InputObject`, you have full control over the conversation:
| `Messages` | `[]Message` | Array of conversation messages |
| `Tools` | `[]Tool` | Array of function tools available to the model |
| `ToolChoice` | `any` | Controls which tool (if any) the model should call. Can be `string` (`"auto"`, `"none"`) or `map[string]interface{}`. See [Tools documentation](/sdk/go/tools) for details |
+| `Tags` | `[]string` | Optional tags to categorize and label the request for analytics and filtering. Can also be sent via the `x-edgee-tags` header (comma-separated) |
**Example with InputObject:**
@@ -63,6 +64,19 @@ fmt.Println(response.Text())
// "2+2 equals 4."
```
+**Example with Tags:**
+
+```go
+input := edgee.InputObject{
+ Messages: []edgee.Message{
+ {Role: "user", Content: "Summarize this article"},
+ },
+ Tags: []string{"summarization", "production", "user-123"},
+}
+
+response, err := client.Send("gpt-4o", input)
+```
+
#### Map Input
You can also use a `map[string]interface{}` for dynamic input:
diff --git a/sdk/go/stream.mdx b/sdk/go/stream.mdx
index e2dd564..e6d0690 100644
--- a/sdk/go/stream.mdx
+++ b/sdk/go/stream.mdx
@@ -56,6 +56,7 @@ When `input` is an `InputObject` or `map[string]interface{}`, you have full cont
| `Messages` | `[]Message` | Array of conversation messages |
| `Tools` | `[]Tool` | Array of function tools available to the model |
| `ToolChoice` | `any` | Controls which tool (if any) the model should call. See [Tools documentation](/sdk/go/tools) for details |
+| `Tags` | `[]string` | Optional tags to categorize and label the request for analytics and filtering. Can also be sent via the `x-edgee-tags` header (comma-separated) |
For details about `Message` type, see the [Send Method documentation](/sdk/go/send#message-object).
For details about `Tool` and `ToolChoice` types, see the [Tools documentation](/sdk/go/tools).
diff --git a/sdk/openai/index.mdx b/sdk/openai/index.mdx
index 0148214..aafb332 100644
--- a/sdk/openai/index.mdx
+++ b/sdk/openai/index.mdx
@@ -186,6 +186,63 @@ else:
+### Tags
+
+You can add tags to your requests for analytics and filtering using the `x-edgee-tags` header:
+
+
+
+```typescript title="TypeScript"
+import OpenAI from "openai";
+
+const openai = new OpenAI({
+ baseURL: "https://api.edgee.ai/v1",
+ apiKey: process.env.EDGEE_API_KEY,
+ defaultHeaders: {
+ "x-edgee-tags": "production,user-123,summarization",
+ },
+});
+
+// All requests will include these tags
+const completion = await openai.chat.completions.create({
+ model: "gpt-4o",
+ messages: [
+ { role: "user", content: "What is the capital of France?" }
+ ],
+});
+```
+
+```python title="Python"
+from openai import OpenAI
+from os import getenv
+
+# Tags applied to all requests via default headers
+client = OpenAI(
+ base_url="https://api.edgee.ai/v1",
+ api_key=getenv("EDGEE_API_KEY"),
+ default_headers={
+ "x-edgee-tags": "production,user-123,summarization",
+ },
+)
+
+# Or per-request using extra_headers
+completion = client.chat.completions.create(
+ model="gpt-4o",
+ messages=[
+ {"role": "user", "content": "What is the capital of France?"},
+ ],
+ extra_headers={
+ "x-edgee-tags": "one-off-tag,experiment",
+ },
+)
+```
+
+
+
+
+ Tags are comma-separated strings in the header. They help you categorize and filter requests in Edgee's analytics dashboard.
+
+
### Streaming Responses
Edgee supports streaming responses for real-time token delivery:
diff --git a/sdk/python/send.mdx b/sdk/python/send.mdx
index 8a3a351..20c71cd 100644
--- a/sdk/python/send.mdx
+++ b/sdk/python/send.mdx
@@ -41,6 +41,7 @@ When `input` is an `InputObject` or dictionary, you have full control over the c
| `messages` | `list[dict]` | Array of conversation messages |
| `tools` | `list[dict] \| None` | Array of function tools available to the model |
| `tool_choice` | `str \| dict \| None` | Controls which tool (if any) the model should call. See [Tools documentation](/sdk/python/tools) for details |
+| `tags` | `list[str] \| None` | Optional tags to categorize and label the request for analytics and filtering. Can also be sent via the `x-edgee-tags` header (comma-separated) |
**Example with Dictionary Input:**
@@ -58,6 +59,20 @@ print(response.text)
# "2+2 equals 4."
```
+**Example with Tags:**
+
+```python
+response = edgee.send(
+ model="gpt-4o",
+ input={
+ "messages": [
+ {"role": "user", "content": "Summarize this article"}
+ ],
+ "tags": ["summarization", "production", "user-123"]
+ }
+)
+```
+
### Message Object
Each message in the `messages` array has the following structure:
diff --git a/sdk/python/stream.mdx b/sdk/python/stream.mdx
index 16d1b55..752b2b4 100644
--- a/sdk/python/stream.mdx
+++ b/sdk/python/stream.mdx
@@ -39,6 +39,7 @@ When `input` is an `InputObject` or dictionary, you have full control over the c
| `messages` | `list[dict]` | Array of conversation messages |
| `tools` | `list[dict] \| None` | Array of function tools available to the model |
| `tool_choice` | `str \| dict \| None` | Controls which tool (if any) the model should call. See [Tools documentation](/sdk/python/tools) for details |
+| `tags` | `list[str] \| None` | Optional tags to categorize and label the request for analytics and filtering. Can also be sent via the `x-edgee-tags` header (comma-separated) |
For details about `Message` type, see the [Send Method documentation](/sdk/python/send#message-object).
For details about `Tool` and `ToolChoice` types, see the [Tools documentation](/sdk/python/tools).
diff --git a/sdk/rust/send.mdx b/sdk/rust/send.mdx
index 92524b2..703c9e1 100644
--- a/sdk/rust/send.mdx
+++ b/sdk/rust/send.mdx
@@ -56,6 +56,7 @@ When `input` is an `InputObject`, you have full control over the conversation:
| `messages` | `Vec` | Array of conversation messages |
| `tools` | `Option>` | Array of function tools available to the model |
| `tool_choice` | `Option` | Controls which tool (if any) the model should call. See [Tools documentation](/sdk/rust/tools) for details |
+| `tags` | `Option>` | Optional tags to categorize and label the request for analytics and filtering. Can also be sent via the `x-edgee-tags` header (comma-separated) |
**Example with InputObject:**
@@ -71,6 +72,22 @@ println!("{}", response.text().unwrap_or(""));
// "2+2 equals 4."
```
+**Example with Tags:**
+
+```rust
+use edgee::{Message, InputObject};
+
+let input = InputObject::new(vec![
+ Message::user("Summarize this article")
+]).with_tags(vec![
+ "summarization".to_string(),
+ "production".to_string(),
+ "user-123".to_string()
+]);
+
+let response = client.send("gpt-4o", input).await?;
+```
+
### Message Object
Each message in the `messages` array is created using `Message` constructors:
diff --git a/sdk/rust/stream.mdx b/sdk/rust/stream.mdx
index df72ebe..f4a1ba1 100644
--- a/sdk/rust/stream.mdx
+++ b/sdk/rust/stream.mdx
@@ -54,6 +54,7 @@ When `input` is a `Vec` or `InputObject`, you have full control over th
| `messages` | `Vec` | Array of conversation messages |
| `tools` | `Option>` | Array of function tools available to the model |
| `tool_choice` | `Option` | Controls which tool (if any) the model should call. See [Tools documentation](/sdk/rust/tools) for details |
+| `tags` | `Option>` | Optional tags to categorize and label the request for analytics and filtering. Can also be sent via the `x-edgee-tags` header (comma-separated) |
For details about `Message` type, see the [Send Method documentation](/sdk/rust/send#message-object).
For details about `Tool` and `ToolChoice` types, see the [Tools documentation](/sdk/rust/tools).
diff --git a/sdk/typescript/send.mdx b/sdk/typescript/send.mdx
index ff8cf61..f3a04f8 100644
--- a/sdk/typescript/send.mdx
+++ b/sdk/typescript/send.mdx
@@ -44,6 +44,7 @@ When `input` is an `InputObject`, you have full control over the conversation:
| `messages` | `Message[]` | Array of conversation messages |
| `tools` | `Tool[]` | Array of function tools available to the model |
| `tool_choice` | `ToolChoice` | Controls which tool (if any) the model should call. See [Tools documentation](/sdk/typescript/tools) for details |
+| `tags` | `string[]` | Optional tags to categorize and label the request for analytics and filtering. Can also be sent via the `x-edgee-tags` header (comma-separated) |
**Example with InputObject:**
@@ -61,6 +62,20 @@ console.log(response.text);
// "2+2 equals 4."
```
+**Example with Tags:**
+
+```typescript
+const response = await edgee.send({
+ model: 'gpt-4o',
+ input: {
+ messages: [
+ { role: 'user', content: 'Summarize this article' }
+ ],
+ tags: ['summarization', 'production', 'user-123']
+ }
+});
+```
+
### Message Object
Each message in the `messages` array has the following structure:
diff --git a/sdk/typescript/stream.mdx b/sdk/typescript/stream.mdx
index 93a00d0..8c925de 100644
--- a/sdk/typescript/stream.mdx
+++ b/sdk/typescript/stream.mdx
@@ -44,6 +44,7 @@ When `input` is an `InputObject`, you have full control over the conversation:
| `messages` | `Message[]` | Array of conversation messages |
| `tools` | `Tool[]` | Array of function tools available to the model |
| `tool_choice` | `ToolChoice` | Controls which tool (if any) the model should call. See [Tools documentation](/sdk/typescript/tools) for details |
+| `tags` | `string[]` | Optional tags to categorize and label the request for analytics and filtering. Can also be sent via the `x-edgee-tags` header (comma-separated) |
For details about `Message` type, see the [Send Method documentation](/sdk/typescript/send#message-object).
For details about `Tool` and `ToolChoice` types, see the [Tools documentation](/sdk/typescript/tools).