Core - Retrieve identity with metrics
curl --get 'https://api.orq.ai/v2/identities/customer_12345' \
--header 'Authorization: Bearer $ORQ_API_KEY' \
--data-urlencode 'include_metrics=true'
import { Orq } from '@orq-ai/node';
const client = new Orq({
apiKey: process.env.ORQ_API_KEY,
});
const result = await client.identities.retrieve({
id: 'customer_12345',
includeMetrics: true,
});
console.log(result.identity.displayName);
console.log(result.identity.metrics.totalRequests);
import os
from orq_ai_sdk import Orq
client = Orq(api_key=os.environ["ORQ_API_KEY"])
result = client.identities.retrieve(
id="customer_12345",
include_metrics=True,
)
print(result.identity.display_name)
print(result.identity.metrics.total_requests)
{
"identity": {
"_id": "<string>",
"external_id": "<string>",
"workspace_id": "<string>",
"created": "<string>",
"updated": "<string>",
"display_name": "<string>",
"email": "<string>",
"avatar_url": "<string>",
"tags": [
"<string>"
],
"metadata": {},
"metrics": {
"total_tokens": 123,
"total_cost": 123,
"total_requests": 123,
"error_rate": 123
},
"budget": {
"budget_id": "<string>",
"limits": {
"amount": 123,
"token_limit": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"scope": {
"workspace": {},
"project": {
"project_id": "<string>"
},
"identity": {
"identity_external_id": "<string>"
},
"api_key": {
"api_key_id": "<string>"
},
"provider": {
"provider": "<string>"
},
"model": {
"model_id": "<string>"
}
},
"match": {
"cel": "<string>"
},
"rate_limit": {
"requests_per_minute": 123
},
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z",
"usage": {
"amount": 123,
"tokens": 123,
"requests": 123
},
"alerts": [
{
"threshold_percent": 123,
"notifier_ids": [
"<string>"
],
"id": "<string>"
}
]
}
}
}Identities
Retrieve an identity
Retrieves detailed information about a specific identity using their identity ID or external ID from your system.
GET
/
v2
/
identities
/
{id}
Core - Retrieve identity with metrics
curl --get 'https://api.orq.ai/v2/identities/customer_12345' \
--header 'Authorization: Bearer $ORQ_API_KEY' \
--data-urlencode 'include_metrics=true'
import { Orq } from '@orq-ai/node';
const client = new Orq({
apiKey: process.env.ORQ_API_KEY,
});
const result = await client.identities.retrieve({
id: 'customer_12345',
includeMetrics: true,
});
console.log(result.identity.displayName);
console.log(result.identity.metrics.totalRequests);
import os
from orq_ai_sdk import Orq
client = Orq(api_key=os.environ["ORQ_API_KEY"])
result = client.identities.retrieve(
id="customer_12345",
include_metrics=True,
)
print(result.identity.display_name)
print(result.identity.metrics.total_requests)
{
"identity": {
"_id": "<string>",
"external_id": "<string>",
"workspace_id": "<string>",
"created": "<string>",
"updated": "<string>",
"display_name": "<string>",
"email": "<string>",
"avatar_url": "<string>",
"tags": [
"<string>"
],
"metadata": {},
"metrics": {
"total_tokens": 123,
"total_cost": 123,
"total_requests": 123,
"error_rate": 123
},
"budget": {
"budget_id": "<string>",
"limits": {
"amount": 123,
"token_limit": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"scope": {
"workspace": {},
"project": {
"project_id": "<string>"
},
"identity": {
"identity_external_id": "<string>"
},
"api_key": {
"api_key_id": "<string>"
},
"provider": {
"provider": "<string>"
},
"model": {
"model_id": "<string>"
}
},
"match": {
"cel": "<string>"
},
"rate_limit": {
"requests_per_minute": 123
},
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z",
"usage": {
"amount": 123,
"tokens": 123,
"requests": 123
},
"alerts": [
{
"threshold_percent": 123,
"notifier_ids": [
"<string>"
],
"id": "<string>"
}
]
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identity ID to retrieve.
Query Parameters
Include aggregate usage metrics on the returned identity.
When true, embed the identity-scoped budget (config and limits only, no live usage) on the returned record.
Response
200 - application/json
OK
Requested identity.
Show child attributes
Show child attributes
Was this page helpful?
⌘I