Overview
Observability endpointsAvailable Operations
- list - List observability destinations
- create - Create an observability destination
- delete - Delete an observability destination
- get - Get an observability destination
- update - Update an observability destination
list
List the observability destinations configured for the authenticated entity’s default workspace. Use theworkspace_id query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. Management key required.
Example Usage
from openrouter import OpenRouter
import os
with OpenRouter(
http_referer="<value>",
x_open_router_title="<value>",
x_open_router_categories="<value>",
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
res = open_router.observability.list(offset=0, limit=50)
while res is not None:
# Handle items
res = res.next()
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
http_referer | Optional[str] | :heavy_minus_sign: | The app identifier should be your app’s URL and is used as the primary identifier for rankings. This is used to track API usage per application. | |
x_open_router_title | Optional[str] | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter’s dashboard. | |
x_open_router_categories | Optional[str] | :heavy_minus_sign: | Comma-separated list of app categories (e.g. “cli-agent,cloud-agent”). Used for marketplace rankings. | |
offset | OptionalNullable[int] | :heavy_minus_sign: | Number of records to skip for pagination | 0 |
limit | Optional[int] | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 |
workspace_id | Optional[str] | :heavy_minus_sign: | Optional workspace ID to filter by. Defaults to the authenticated entity’s default workspace. | 550e8400-e29b-41d4-a716-446655440000 |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
Response
operations.ListObservabilityDestinationsResponseErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponseError | 400 | application/json |
| errors.UnauthorizedResponseError | 401 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |
create
Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity’s default workspace; use theworkspace_id body field to scope to a different workspace. Management key required.
Example Usage
from openrouter import OpenRouter
import os
with OpenRouter(
http_referer="<value>",
x_open_router_title="<value>",
x_open_router_categories="<value>",
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
res = open_router.observability.create(config={
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd",
}, name="Production Langfuse", type_="langfuse", broadcast_generation_cost=False, broadcast_generation_identity=False, broadcast_generation_request_context=False, enabled=True, privacy_mode=False)
# Handle response
print(res)
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
config | Dict[str, Any] | :heavy_check_mark: | Provider-specific configuration. The shape depends on type and is validated server-side. | { “baseUrl”: “https://us.cloud.langfuse.com”, “publicKey”: “pk-l…EfGh”, “secretKey”: “sk-l…AbCd” } |
name | str | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse |
type | components.CreateObservabilityDestinationRequestType | :heavy_check_mark: | The destination type. Only stable destination types are accepted. | langfuse |
http_referer | Optional[str] | :heavy_minus_sign: | The app identifier should be your app’s URL and is used as the primary identifier for rankings. This is used to track API usage per application. | |
x_open_router_title | Optional[str] | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter’s dashboard. | |
x_open_router_categories | Optional[str] | :heavy_minus_sign: | Comma-separated list of app categories (e.g. “cli-agent,cloud-agent”). Used for marketplace rankings. | |
api_key_hashes | List[str] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. null or omitted means all keys. Must contain at least one hash if provided. | null |
broadcast_generation_cost | Optional[bool] | :heavy_minus_sign: | When true, include cost and billing generation metadata. | false |
broadcast_generation_identity | Optional[bool] | :heavy_minus_sign: | When true, include identity generation metadata. | false |
broadcast_generation_request_context | Optional[bool] | :heavy_minus_sign: | When true, include request-context generation metadata. | false |
enabled | Optional[bool] | :heavy_minus_sign: | Whether this destination should be enabled immediately. | true |
filter_rules | OptionalNullable[components.ObservabilityFilterRulesConfigNullable] | :heavy_minus_sign: | Optional structured filter rules controlling which events are forwarded. | null |
privacy_mode | Optional[bool] | :heavy_minus_sign: | When true, request/response bodies are not forwarded — only metadata. | false |
sampling_rate | Optional[float] | :heavy_minus_sign: | Sampling rate between 0.0001 and 1 (1 = 100%). | 1 |
workspace_id | Optional[str] | :heavy_minus_sign: | Optional workspace ID. Defaults to the authenticated entity’s default workspace. | 550e8400-e29b-41d4-a716-446655440000 |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
Response
components.CreateObservabilityDestinationResponseErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponseError | 400 | application/json |
| errors.UnauthorizedResponseError | 401 | application/json |
| errors.ForbiddenResponseError | 403 | application/json |
| errors.ConflictResponseError | 409 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |
delete
Delete an existing observability destination. This performs a soft delete. Management key required.Example Usage
from openrouter import OpenRouter
import os
with OpenRouter(
http_referer="<value>",
x_open_router_title="<value>",
x_open_router_categories="<value>",
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
res = open_router.observability.delete(id="99999999-aaaa-bbbb-cccc-dddddddddddd")
# Handle response
print(res)
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
id | str | :heavy_check_mark: | The destination ID (UUID). | 99999999-aaaa-bbbb-cccc-dddddddddddd |
http_referer | Optional[str] | :heavy_minus_sign: | The app identifier should be your app’s URL and is used as the primary identifier for rankings. This is used to track API usage per application. | |
x_open_router_title | Optional[str] | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter’s dashboard. | |
x_open_router_categories | Optional[str] | :heavy_minus_sign: | Comma-separated list of app categories (e.g. “cli-agent,cloud-agent”). Used for marketplace rankings. | |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
Response
components.DeleteObservabilityDestinationResponseErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.UnauthorizedResponseError | 401 | application/json |
| errors.NotFoundResponseError | 404 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |
get
Fetch a single observability destination by its UUID. Management key required.Example Usage
from openrouter import OpenRouter
import os
with OpenRouter(
http_referer="<value>",
x_open_router_title="<value>",
x_open_router_categories="<value>",
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
res = open_router.observability.get(id="99999999-aaaa-bbbb-cccc-dddddddddddd")
# Handle response
print(res)
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
id | str | :heavy_check_mark: | The destination ID (UUID). | 99999999-aaaa-bbbb-cccc-dddddddddddd |
http_referer | Optional[str] | :heavy_minus_sign: | The app identifier should be your app’s URL and is used as the primary identifier for rankings. This is used to track API usage per application. | |
x_open_router_title | Optional[str] | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter’s dashboard. | |
x_open_router_categories | Optional[str] | :heavy_minus_sign: | Comma-separated list of app categories (e.g. “cli-agent,cloud-agent”). Used for marketplace rankings. | |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
Response
components.GetObservabilityDestinationResponseErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.UnauthorizedResponseError | 401 | application/json |
| errors.NotFoundResponseError | 404 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |
update
Update an existing observability destination. Only the fields provided in the request body are updated. Management key required.Example Usage
from openrouter import OpenRouter
import os
with OpenRouter(
http_referer="<value>",
x_open_router_title="<value>",
x_open_router_categories="<value>",
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
res = open_router.observability.update(id="99999999-aaaa-bbbb-cccc-dddddddddddd", enabled=False, name="Updated Langfuse")
# Handle response
print(res)
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
id | str | :heavy_check_mark: | The destination ID (UUID). | 99999999-aaaa-bbbb-cccc-dddddddddddd |
http_referer | Optional[str] | :heavy_minus_sign: | The app identifier should be your app’s URL and is used as the primary identifier for rankings. This is used to track API usage per application. | |
x_open_router_title | Optional[str] | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter’s dashboard. | |
x_open_router_categories | Optional[str] | :heavy_minus_sign: | Comma-separated list of app categories (e.g. “cli-agent,cloud-agent”). Used for marketplace rankings. | |
api_key_hashes | List[str] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes. null clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided. | null |
broadcast_generation_cost | Optional[bool] | :heavy_minus_sign: | Whether to include cost and billing generation metadata. | false |
broadcast_generation_identity | Optional[bool] | :heavy_minus_sign: | Whether to include identity generation metadata. | false |
broadcast_generation_request_context | Optional[bool] | :heavy_minus_sign: | Whether to include request-context generation metadata. | false |
config | Dict[str, Any] | :heavy_minus_sign: | Provider-specific configuration fields to update. Masked values are ignored; unset fields keep their current value. | { “baseUrl”: “https://us.cloud.langfuse.com”, “publicKey”: “pk-l…EfGh”, “secretKey”: “sk-l…AbCd” } |
enabled | Optional[bool] | :heavy_minus_sign: | Whether the destination is enabled. | true |
filter_rules | OptionalNullable[components.ObservabilityFilterRulesConfigNullable] | :heavy_minus_sign: | N/A | null |
name | Optional[str] | :heavy_minus_sign: | Human-readable name for the destination. | Production Langfuse |
privacy_mode | Optional[bool] | :heavy_minus_sign: | When true, request/response bodies are not forwarded — only metadata. | false |
sampling_rate | Optional[float] | :heavy_minus_sign: | Sampling rate between 0.0001 and 1 (1 = 100%). | 1 |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
Response
components.UpdateObservabilityDestinationResponseErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponseError | 400 | application/json |
| errors.UnauthorizedResponseError | 401 | application/json |
| errors.ForbiddenResponseError | 403 | application/json |
| errors.NotFoundResponseError | 404 | application/json |
| errors.ConflictResponseError | 409 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |