Skip to main content

Overview

Observability endpoints

Available 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 the workspace_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()

    while res is not None:
        # Handle items

        res = res.next()

Parameters

ParameterTypeRequiredDescriptionExample
http_refererOptional[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_titleOptional[str]:heavy_minus_sign:The app display name allows you to customize how your app appears in OpenRouter’s dashboard.
x_open_router_categoriesOptional[str]:heavy_minus_sign:Comma-separated list of app categories (e.g. “cli-agent,cloud-agent”). Used for marketplace rankings.
offsetOptional[int]:heavy_minus_sign:Number of records to skip for pagination0
limitOptional[int]:heavy_minus_sign:Maximum number of records to return (max 100)50
workspace_idOptional[str]:heavy_minus_sign:Optional workspace ID to filter by. Defaults to the authenticated entity’s default workspace.550e8400-e29b-41d4-a716-446655440000
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

operations.ListObservabilityDestinationsResponse

Errors

Error TypeStatus CodeContent Type
errors.UnauthorizedResponseError401application/json
errors.InternalServerResponseError500application/json
errors.OpenRouterDefaultError4XX, 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 the workspace_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", enabled=True, privacy_mode=False)

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescriptionExample
configDict[str, Nullable[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”
}
namestr:heavy_check_mark:Human-readable name for the destination.Production Langfuse
typecomponents.CreateObservabilityDestinationRequestType:heavy_check_mark:The destination type. Only stable destination types are accepted.langfuse
http_refererOptional[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_titleOptional[str]:heavy_minus_sign:The app display name allows you to customize how your app appears in OpenRouter’s dashboard.
x_open_router_categoriesOptional[str]:heavy_minus_sign:Comma-separated list of app categories (e.g. “cli-agent,cloud-agent”). Used for marketplace rankings.
api_key_hashesList[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
enabledOptional[bool]:heavy_minus_sign:Whether this destination should be enabled immediately.true
filter_rulesOptionalNullable[components.ObservabilityFilterRulesConfig]:heavy_minus_sign:Optional structured filter rules controlling which events are forwarded.null
privacy_modeOptional[bool]:heavy_minus_sign:When true, request/response bodies are not forwarded — only metadata.false
sampling_rateOptional[float]:heavy_minus_sign:Sampling rate between 0.0001 and 1 (1 = 100%).1
workspace_idOptional[str]:heavy_minus_sign:Optional workspace ID. Defaults to the authenticated entity’s default workspace.550e8400-e29b-41d4-a716-446655440000
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

components.CreateObservabilityDestinationResponse

Errors

Error TypeStatus CodeContent Type
errors.BadRequestResponseError400application/json
errors.UnauthorizedResponseError401application/json
errors.ForbiddenResponseError403application/json
errors.ConflictResponseError409application/json
errors.InternalServerResponseError500application/json
errors.OpenRouterDefaultError4XX, 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

ParameterTypeRequiredDescriptionExample
idstr:heavy_check_mark:The destination ID (UUID).99999999-aaaa-bbbb-cccc-dddddddddddd
http_refererOptional[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_titleOptional[str]:heavy_minus_sign:The app display name allows you to customize how your app appears in OpenRouter’s dashboard.
x_open_router_categoriesOptional[str]:heavy_minus_sign:Comma-separated list of app categories (e.g. “cli-agent,cloud-agent”). Used for marketplace rankings.
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

components.DeleteObservabilityDestinationResponse

Errors

Error TypeStatus CodeContent Type
errors.UnauthorizedResponseError401application/json
errors.NotFoundResponseError404application/json
errors.InternalServerResponseError500application/json
errors.OpenRouterDefaultError4XX, 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

ParameterTypeRequiredDescriptionExample
idstr:heavy_check_mark:The destination ID (UUID).99999999-aaaa-bbbb-cccc-dddddddddddd
http_refererOptional[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_titleOptional[str]:heavy_minus_sign:The app display name allows you to customize how your app appears in OpenRouter’s dashboard.
x_open_router_categoriesOptional[str]:heavy_minus_sign:Comma-separated list of app categories (e.g. “cli-agent,cloud-agent”). Used for marketplace rankings.
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

components.GetObservabilityDestinationResponse

Errors

Error TypeStatus CodeContent Type
errors.UnauthorizedResponseError401application/json
errors.NotFoundResponseError404application/json
errors.InternalServerResponseError500application/json
errors.OpenRouterDefaultError4XX, 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

ParameterTypeRequiredDescriptionExample
idstr:heavy_check_mark:The destination ID (UUID).99999999-aaaa-bbbb-cccc-dddddddddddd
http_refererOptional[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_titleOptional[str]:heavy_minus_sign:The app display name allows you to customize how your app appears in OpenRouter’s dashboard.
x_open_router_categoriesOptional[str]:heavy_minus_sign:Comma-separated list of app categories (e.g. “cli-agent,cloud-agent”). Used for marketplace rankings.
api_key_hashesList[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
configDict[str, Nullable[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”
}
enabledOptional[bool]:heavy_minus_sign:Whether the destination is enabled.true
filter_rulesOptionalNullable[components.ObservabilityFilterRulesConfig]:heavy_minus_sign:N/Anull
nameOptional[str]:heavy_minus_sign:Human-readable name for the destination.Production Langfuse
privacy_modeOptional[bool]:heavy_minus_sign:When true, request/response bodies are not forwarded — only metadata.false
sampling_rateOptional[float]:heavy_minus_sign:Sampling rate between 0.0001 and 1 (1 = 100%).1
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

components.UpdateObservabilityDestinationResponse

Errors

Error TypeStatus CodeContent Type
errors.BadRequestResponseError400application/json
errors.UnauthorizedResponseError401application/json
errors.NotFoundResponseError404application/json
errors.ConflictResponseError409application/json
errors.InternalServerResponseError500application/json
errors.OpenRouterDefaultError4XX, 5XX*/*