Tree BG 1
Tree
Tree
TreeLeaves
TreeLeaves
Cat IdleGrassGrassRockRock

Beta Observability Spans Endpoints

(beta) Observability API - spans.

Search spans

POST /v1/observability/spans/search

Search spans

200

Successful Response

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.observability.spans.searchSpans({
    spansRequest: {},
  });

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.observability.spans.search_spans(page_size=50)

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/observability/spans/search \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{}'

200

{
  "spans": {}
}

Search span evaluations

POST /v1/observability/spans/evaluations/search

Search span evaluations

200

Successful Response

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.observability.spans.searchSpanEvaluations({
    spanEvaluationsRequest: {},
  });

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.observability.spans.search_span_evaluations(page_size=50)

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/observability/spans/evaluations/search \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{}'

200

{
  "span_evaluations": {}
}

Search latest span evaluations

POST /v1/observability/spans/evaluations/search/latest

Search latest span evaluations

200

Successful Response

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.observability.spans.searchLatestSpanEvaluations({
    spanEvaluationsRequest: {},
  });

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.observability.spans.search_latest_span_evaluations(page_size=50)

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/observability/spans/evaluations/search/latest \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{}'

200

{
  "span_evaluations": {}
}

Get span field definitions

GET /v1/observability/spans/fields

Get span field definitions

200

Successful Response

field_definitions
*array<OtelFieldDefinition>

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.observability.spans.listSpanFields();

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.observability.spans.list_span_fields()

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/observability/spans/fields \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "field_definitions": [
    {
      "label": "approved",
      "name": "My resource",
      "supported_operators": [
        "eq"
      ],
      "type": "ENUM"
    }
  ]
}

Get span evaluation field definitions

GET /v1/observability/spans/evaluations/fields

Get span evaluation field definitions

200

Successful Response

field_definitions
*array<OtelFieldDefinition>

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.observability.spans.listSpanEvalFields();

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.observability.spans.list_span_eval_fields()

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/observability/spans/evaluations/fields \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "field_definitions": [
    {
      "label": "approved",
      "name": "My resource",
      "supported_operators": [
        "eq"
      ],
      "type": "ENUM"
    }
  ]
}

Get options for a span field

GET /v1/observability/spans/fields/{field_name}/options

Get options for a span field

200

Successful Response

options
*array<string>|null

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.observability.spans.fetchSpanFieldOptions({
    fieldName: "<value>",
  });

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.observability.spans.fetch_span_field_options(field_name="<value>")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/observability/spans/fields/{field_name}/options \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "options": null
}

Get options for a span evaluation field

GET /v1/observability/spans/evaluations/fields/{field_name}/options

Get options for a span evaluation field

200

Successful Response

options
*array<string>|null

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.observability.spans.fetchSpanEvalFieldOptions({
    fieldName: "<value>",
  });

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.observability.spans.fetch_span_eval_field_options(field_name="<value>")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/observability/spans/evaluations/fields/{field_name}/options \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "options": null
}