End users
List the budgets the calling service key may put its end users on, with their limits and end user counts.
Requires a service key. Each budget's name, limits and period are the ones every end user on it is held to. The counts cover the end users of the key's user, blocked ones included and deleted ones not.
Enter your API key here (sent as Otari-Key header).
Successful Response
A budget a service key may put its end users on, and how many of them are on it.
End users of the key's user on this budget, blocked ones included
Whether a new end user starts here when its request names no budget
Dollars each end user may spend over the period
GET /api/v1/end-user-budgets HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
Successful Response
[
{
"blocked_end_user_count": 1,
"budget_duration_sec": 1,
"budget_id": "text",
"end_user_count": 1,
"is_default": true,
"max_budget": 1,
"name": "text",
"request_limit": 1,
"reset_alignment": "text",
"rpm_limit": 1,
"token_limit": 1,
"tpm_limit": 1
}
]List the end users of the calling service key, oldest first.
Requires a service key. End users belong to the key's user, so every service key of one user lists the same end users. A deleted end user is not listed. external_id reads one end user by any id, one containing '/' included, as a list of zero or one.
Enter your API key here (sent as Otari-Key header).
0100Only end users on this budget.
Only end users that are, or are not, blocked.
Only the end user the service names with this user value: zero or one.
Also count every matching end user, in the Otari-Total-Count response header.
falseSuccessful Response
An end user of a service key, addressed by the id the service named it by.
Validation Error
GET /api/v1/end-users HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
[
{
"blocked": true,
"budget_id": "text",
"budget_started_at": "text",
"created_at": "text",
"current_requests": 1,
"current_tokens": 1,
"external_id": "text",
"next_budget_reset_at": "text",
"owner_user_id": "text",
"reserved": 1,
"spend": 1,
"user_id": "text"
}
]Put the end user named by external_id on a budget from the key's list, creating it if needed.
The same as PUT /end-users/{external_id}, for any id, one containing '/' included.
Enter your API key here (sent as Otari-Key header).
The id the service names the end user by in a request's user field, any id, '/' included
Create an end user ahead of its first request, or move one, onto a budget on the key's list.
A budget on the key's end_user_budget_ids
Successful Response
An end user of a service key, addressed by the id the service named it by.
The end user was created
Validation Error
PUT /api/v1/end-users?external_id=text HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 20
{
"budget_id": "text"
}{
"blocked": true,
"budget_id": "text",
"budget_started_at": "text",
"created_at": "text",
"current_requests": 1,
"current_tokens": 1,
"external_id": "text",
"next_budget_reset_at": "text",
"owner_user_id": "text",
"reserved": 1,
"spend": 1,
"user_id": "text"
}Block, unblock or move the end user named by external_id.
The same as PATCH /end-users/{external_id}, for any id, one containing '/' included.
Enter your API key here (sent as Otari-Key header).
The id the service names the end user by in a request's user field, any id, '/' included
Block, unblock or move an end user. An omitted field is left as it is.
Whether the end user is refused
A budget on the key's end_user_budget_ids to move the end user to
Successful Response
An end user of a service key, addressed by the id the service named it by.
Validation Error
PATCH /api/v1/end-users?external_id=text HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 35
{
"blocked": true,
"budget_id": "text"
}{
"blocked": true,
"budget_id": "text",
"budget_started_at": "text",
"created_at": "text",
"current_requests": 1,
"current_tokens": 1,
"external_id": "text",
"next_budget_reset_at": "text",
"owner_user_id": "text",
"reserved": 1,
"spend": 1,
"user_id": "text"
}Delete one end user of the calling service key, or a page of those created before a time.
Requires a service key, and exactly one of external_id and created_before. external_id deletes that end user, any id, one containing '/' included, and answers 404 when it has none. created_before deletes up to limit of the oldest end users created before then; call again until deleted is 0. An end user's telemetry and agent traces are erased with it. The end user's row and spend are kept: a request naming it again revives it with what it had spent, so deleting one cannot clear its budget. A deleted end user is neither listed nor counted.
Enter your API key here (sent as Otari-Key header).
Delete the end user the service names with this user value.
Delete the end users created before this time, oldest first, up to limit of them.
The most end users one call deletes with created_before.
100Successful Response
How many end users a delete removed.
End users deleted by this call. A page as full as the limit may leave more.
Validation Error
DELETE /api/v1/end-users HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"deleted": 1
}Get an end user of the calling service key by the id the service names it by.
Requires a service key. An id no end user of the key's user goes by answers 404. An id with a '.' or '..' segment is refused with 400; GET /end-users?external_id= reads any end user.
Enter your API key here (sent as Otari-Key header).
The id the service names the end user by in a request's user field
Successful Response
An end user of a service key, addressed by the id the service named it by.
Validation Error
GET /api/v1/end-users/{external_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"blocked": true,
"budget_id": "text",
"budget_started_at": "text",
"created_at": "text",
"current_requests": 1,
"current_tokens": 1,
"external_id": "text",
"next_budget_reset_at": "text",
"owner_user_id": "text",
"reserved": 1,
"spend": 1,
"user_id": "text"
}Put an end user of the calling service key on a budget from the key's list, creating it if needed.
Requires a service key. Answers 201 when the end user was created. An end user already on the budget keeps its current period, so repeating the call changes nothing. A budget that is not on the key's end_user_budget_ids is refused with 403 and end_user_budget_not_allowed. An id with a '.' or '..' segment is refused with 400; PUT /end-users?external_id= takes any id.
Enter your API key here (sent as Otari-Key header).
The id the service names the end user by in a request's user field
Create an end user ahead of its first request, or move one, onto a budget on the key's list.
A budget on the key's end_user_budget_ids
Successful Response
An end user of a service key, addressed by the id the service named it by.
The end user was created
Validation Error
PUT /api/v1/end-users/{external_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 20
{
"budget_id": "text"
}{
"blocked": true,
"budget_id": "text",
"budget_started_at": "text",
"created_at": "text",
"current_requests": 1,
"current_tokens": 1,
"external_id": "text",
"next_budget_reset_at": "text",
"owner_user_id": "text",
"reserved": 1,
"spend": 1,
"user_id": "text"
}Block, unblock or move an end user of the calling service key.
Requires a service key. A move restarts the end user's period on the new budget but keeps what it has spent and used so far. The budget must be on the key's end_user_budget_ids, or the move is refused with 403 and end_user_budget_not_allowed. An id with a '.' or '..' segment is refused with 400; PATCH /end-users?external_id= takes any id.
Enter your API key here (sent as Otari-Key header).
The id the service names the end user by in a request's user field
Block, unblock or move an end user. An omitted field is left as it is.
Whether the end user is refused
A budget on the key's end_user_budget_ids to move the end user to
Successful Response
An end user of a service key, addressed by the id the service named it by.
Validation Error
PATCH /api/v1/end-users/{external_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 35
{
"blocked": true,
"budget_id": "text"
}{
"blocked": true,
"budget_id": "text",
"budget_started_at": "text",
"created_at": "text",
"current_requests": 1,
"current_tokens": 1,
"external_id": "text",
"next_budget_reset_at": "text",
"owner_user_id": "text",
"reserved": 1,
"spend": 1,
"user_id": "text"
}Delete an end user of the calling service key by the id the service names it by.
Requires a service key. An id no live end user of the key's user goes by answers 404. The end user's telemetry and agent traces are erased; its row and spend are kept, so a request naming it again revives it with what it had spent. An id with a '.' or '..' segment is refused with 400; DELETE /end-users?external_id= takes any id.
Enter your API key here (sent as Otari-Key header).
The id the service names the end user by in a request's user field
Successful Response
No content
Validation Error
DELETE /api/v1/end-users/{external_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
No content
Last updated
Was this helpful?
