












Beta Observability Spans Endpoints
(beta) Observability API - spans.












Examples
Real world code examples
Search spans
POST /v1/observability/spans/search
Search spans
search_expression
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();
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)
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 '{}'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": {}
}{
"spans": {}
}Search span evaluations
POST /v1/observability/spans/evaluations/search
Search span evaluations
search_expression
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();
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)
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 '{}'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": {}
}{
"span_evaluations": {}
}Search latest span evaluations
POST /v1/observability/spans/evaluations/search/latest
Search latest span evaluations
search_expression
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();
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)
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 '{}'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": {}
}{
"span_evaluations": {}
}Get span field definitions
GET /v1/observability/spans/fields
Get span field definitions
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.listSpanFields();
console.log(result);
}
run();
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)
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'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"
}
]
}{
"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
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();
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)
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'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"
}
]
}{
"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
field_name
from
to
200
Successful Response
options
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();
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)
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'curl https://api.mistral.ai/v1/observability/spans/fields/{field_name}/options \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"options": null
}{
"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
field_name
from
to
200
Successful Response
options
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();
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)
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'curl https://api.mistral.ai/v1/observability/spans/evaluations/fields/{field_name}/options \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"options": null
}{
"options": null
}