Beta.Observability.Traces

June 16, 2026 ยท View on GitHub

Overview

Available Operations

Search traces

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.traces.search(page_size=50)

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
from_date:heavy_minus_sign:N/A
todate:heavy_minus_sign:N/A
page_sizeOptional[int]:heavy_minus_sign:N/A
cursorOptionalNullable[str]:heavy_minus_sign:N/A
search_expressionOptionalNullable[str]:heavy_minus_sign:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.GetTraces

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*

get_trace_fields

Get trace field definitions

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.traces.get_trace_fields()

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.GetTraceFields

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*

get_trace_by_id

Get trace by id

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.traces.get_trace_by_id(trace_id="<id>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
trace_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.GetTrace

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*

get_trace_spans

Get trace spans

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.traces.get_trace_spans(trace_id="<id>", page_size=50)

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
trace_idstr:heavy_check_mark:N/A
from_date:heavy_minus_sign:N/A
todate:heavy_minus_sign:N/A
page_sizeOptional[int]:heavy_minus_sign:N/A
cursorOptionalNullable[str]:heavy_minus_sign:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.GetSpans

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*

fetch_options

Get options for a trace field

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.traces.fetch_options(field_name="<value>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
field_namestr:heavy_check_mark:N/A
from_date:heavy_minus_sign:N/A
todate:heavy_minus_sign:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.GetTraceFieldOptions

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*

get_span_by_id

Get span by id

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.traces.get_span_by_id(trace_id="<id>", span_id="<id>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
trace_idstr:heavy_check_mark:N/A
span_idstr:heavy_check_mark:N/A
from_date:heavy_minus_sign:N/A
todate:heavy_minus_sign:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.GetSpan

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*