curl --request POST \
--url https://api.meshapi.ai/v1/usage/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"org_id": "0190a1b2-3c4d-7e8f-9012-3456789abcde",
"since": "2026-07-01",
"model": [
"openai/gpt-4o-mini"
],
"status": [
"success"
],
"limit": 20,
"offset": 0
}
'import requests
url = "https://api.meshapi.ai/v1/usage/events"
payload = {
"org_id": "0190a1b2-3c4d-7e8f-9012-3456789abcde",
"since": "2026-07-01",
"model": ["openai/gpt-4o-mini"],
"status": ["success"],
"limit": 20,
"offset": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
org_id: '0190a1b2-3c4d-7e8f-9012-3456789abcde',
since: '2026-07-01',
model: ['openai/gpt-4o-mini'],
status: ['success'],
limit: 20,
offset: 0
})
};
fetch('https://api.meshapi.ai/v1/usage/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meshapi.ai/v1/usage/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'org_id' => '0190a1b2-3c4d-7e8f-9012-3456789abcde',
'since' => '2026-07-01',
'model' => [
'openai/gpt-4o-mini'
],
'status' => [
'success'
],
'limit' => 20,
'offset' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.meshapi.ai/v1/usage/events"
payload := strings.NewReader("{\n \"org_id\": \"0190a1b2-3c4d-7e8f-9012-3456789abcde\",\n \"since\": \"2026-07-01\",\n \"model\": [\n \"openai/gpt-4o-mini\"\n ],\n \"status\": [\n \"success\"\n ],\n \"limit\": 20,\n \"offset\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.meshapi.ai/v1/usage/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"org_id\": \"0190a1b2-3c4d-7e8f-9012-3456789abcde\",\n \"since\": \"2026-07-01\",\n \"model\": [\n \"openai/gpt-4o-mini\"\n ],\n \"status\": [\n \"success\"\n ],\n \"limit\": 20,\n \"offset\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meshapi.ai/v1/usage/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"org_id\": \"0190a1b2-3c4d-7e8f-9012-3456789abcde\",\n \"since\": \"2026-07-01\",\n \"model\": [\n \"openai/gpt-4o-mini\"\n ],\n \"status\": [\n \"success\"\n ],\n \"limit\": 20,\n \"offset\": 0\n}"
response = http.request(request)
puts response.read_body{
"events": [
{
"id": "0190a1c0-0000-7000-8000-00000000e1e1",
"key_id": "0190a1b2-0000-7000-8000-0000000000aa",
"key_label": "prod-key",
"user_id": "user_01JZ0Q9WZ7ZK3M9YF6R8D2C4B1",
"end_user_id": "customer-42",
"request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"model": "openai/gpt-4o-mini",
"model_name": "gpt-4o-mini",
"model_provider": "openai",
"stream": false,
"prompt_tokens": 128,
"completion_tokens": 64,
"total_tokens": 192,
"cost_usd": "0.0000480",
"latency_ms": 812,
"tokens_per_second": 78.82,
"status": "success",
"error_code": null,
"error_category": null,
"error_message": null,
"created_at": "2026-07-14T10:15:30+00:00",
"model_type": "text",
"is_byok": false,
"provider": "openai",
"fallback_triggered": false,
"platform_fee_usd": "0.0000024",
"attempt_no": 1,
"is_retry_attempt": false,
"routing_fallback": false
}
],
"total": 1284,
"limit": 50,
"offset": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Query Usage Events
Paginated per-request event history for the authenticated caller.
Accepts either a dashboard session token (JWT) or an rsk_ API key; with an API
key results are scoped to that single key (body org_id / member filters are
ignored). Results are cached for 1 minute per org/filter combination for JWT
callers. Pass ?refresh=true to bypass, or filter by request_id, which is
never served from cache (see below).
curl --request POST \
--url https://api.meshapi.ai/v1/usage/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"org_id": "0190a1b2-3c4d-7e8f-9012-3456789abcde",
"since": "2026-07-01",
"model": [
"openai/gpt-4o-mini"
],
"status": [
"success"
],
"limit": 20,
"offset": 0
}
'import requests
url = "https://api.meshapi.ai/v1/usage/events"
payload = {
"org_id": "0190a1b2-3c4d-7e8f-9012-3456789abcde",
"since": "2026-07-01",
"model": ["openai/gpt-4o-mini"],
"status": ["success"],
"limit": 20,
"offset": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
org_id: '0190a1b2-3c4d-7e8f-9012-3456789abcde',
since: '2026-07-01',
model: ['openai/gpt-4o-mini'],
status: ['success'],
limit: 20,
offset: 0
})
};
fetch('https://api.meshapi.ai/v1/usage/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meshapi.ai/v1/usage/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'org_id' => '0190a1b2-3c4d-7e8f-9012-3456789abcde',
'since' => '2026-07-01',
'model' => [
'openai/gpt-4o-mini'
],
'status' => [
'success'
],
'limit' => 20,
'offset' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.meshapi.ai/v1/usage/events"
payload := strings.NewReader("{\n \"org_id\": \"0190a1b2-3c4d-7e8f-9012-3456789abcde\",\n \"since\": \"2026-07-01\",\n \"model\": [\n \"openai/gpt-4o-mini\"\n ],\n \"status\": [\n \"success\"\n ],\n \"limit\": 20,\n \"offset\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.meshapi.ai/v1/usage/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"org_id\": \"0190a1b2-3c4d-7e8f-9012-3456789abcde\",\n \"since\": \"2026-07-01\",\n \"model\": [\n \"openai/gpt-4o-mini\"\n ],\n \"status\": [\n \"success\"\n ],\n \"limit\": 20,\n \"offset\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meshapi.ai/v1/usage/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"org_id\": \"0190a1b2-3c4d-7e8f-9012-3456789abcde\",\n \"since\": \"2026-07-01\",\n \"model\": [\n \"openai/gpt-4o-mini\"\n ],\n \"status\": [\n \"success\"\n ],\n \"limit\": 20,\n \"offset\": 0\n}"
response = http.request(request)
puts response.read_body{
"events": [
{
"id": "0190a1c0-0000-7000-8000-00000000e1e1",
"key_id": "0190a1b2-0000-7000-8000-0000000000aa",
"key_label": "prod-key",
"user_id": "user_01JZ0Q9WZ7ZK3M9YF6R8D2C4B1",
"end_user_id": "customer-42",
"request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"model": "openai/gpt-4o-mini",
"model_name": "gpt-4o-mini",
"model_provider": "openai",
"stream": false,
"prompt_tokens": 128,
"completion_tokens": 64,
"total_tokens": 192,
"cost_usd": "0.0000480",
"latency_ms": 812,
"tokens_per_second": 78.82,
"status": "success",
"error_code": null,
"error_category": null,
"error_message": null,
"created_at": "2026-07-14T10:15:30+00:00",
"model_type": "text",
"is_byok": false,
"provider": "openai",
"fallback_triggered": false,
"platform_fee_usd": "0.0000024",
"attempt_no": 1,
"is_retry_attempt": false,
"routing_fallback": false
}
],
"total": 1284,
"limit": 50,
"offset": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Enter your MeshAPI key (rsk_...) — sent as Authorization: Bearer <key>.
Headers
Dated version of the API contract to pin this request to. Omit it and the request is served under 2026-08 — the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with 400 invalid_api_version rather than falling back silently. The version actually served is echoed as X-Mesh-Version on every response, including errors.
2026-08 Query Parameters
Body
1 <= x <= 200x >= 0