For the complete documentation index, see llms.txt. This page is also available as Markdown.

End users

List End User Budgets

get

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Responses
200

Successful Response

application/json

A budget a service key may put its end users on, and how many of them are on it.

blocked_end_user_countintegerRequired
budget_duration_secinteger · nullableOptional
budget_idstringRequired
end_user_countintegerRequired

End users of the key's user on this budget, blocked ones included

is_defaultbooleanRequired

Whether a new end user starts here when its request names no budget

max_budgetnumber · nullableOptional

Dollars each end user may spend over the period

namestring · nullableOptional
request_limitinteger · nullableOptional
reset_alignmentstring · nullableOptional
rpm_limitinteger · nullableOptional
token_limitinteger · nullableOptional
tpm_limitinteger · nullableOptional
get/api/v1/end-user-budgets
GET /api/v1/end-user-budgets HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
200

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 End Users

get

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
skipintegerOptionalDefault: 0
limitinteger · min: 1 · max: 1000OptionalDefault: 100
budget_idstring · nullableOptional

Only end users on this budget.

blockedboolean · nullableOptional

Only end users that are, or are not, blocked.

external_idstring · min: 1 · nullableOptional

Only the end user the service names with this user value: zero or one.

include_totalbooleanOptional

Also count every matching end user, in the Otari-Total-Count response header.

Default: false
Responses
200

Successful Response

application/json

An end user of a service key, addressed by the id the service named it by.

blockedbooleanRequired
budget_idstring · nullableRequired
budget_started_atstring · nullableRequired
created_atstringRequired
current_requestsintegerRequired
current_tokensintegerRequired
external_idstringRequired
next_budget_reset_atstring · nullableRequired
owner_user_idstringRequired
reservednumberRequired
spendnumberRequired
user_idstringRequired
get/api/v1/end-users
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 End User By Query

put

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
external_idstring · min: 1Required

The id the service names the end user by in a request's user field, any id, '/' included

Body

Create an end user ahead of its first request, or move one, onto a budget on the key's list.

budget_idstring · min: 1Required

A budget on the key's end_user_budget_ids

Responses
200

Successful Response

application/json

An end user of a service key, addressed by the id the service named it by.

blockedbooleanRequired
budget_idstring · nullableRequired
budget_started_atstring · nullableRequired
created_atstringRequired
current_requestsintegerRequired
current_tokensintegerRequired
external_idstringRequired
next_budget_reset_atstring · nullableRequired
owner_user_idstringRequired
reservednumberRequired
spendnumberRequired
user_idstringRequired
put/api/v1/end-users
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"
}

Update End User By Query

patch

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
external_idstring · min: 1Required

The id the service names the end user by in a request's user field, any id, '/' included

Body

Block, unblock or move an end user. An omitted field is left as it is.

blockedboolean · nullableOptional

Whether the end user is refused

budget_idstring · min: 1 · nullableOptional

A budget on the key's end_user_budget_ids to move the end user to

Responses
200

Successful Response

application/json

An end user of a service key, addressed by the id the service named it by.

blockedbooleanRequired
budget_idstring · nullableRequired
budget_started_atstring · nullableRequired
created_atstringRequired
current_requestsintegerRequired
current_tokensintegerRequired
external_idstringRequired
next_budget_reset_atstring · nullableRequired
owner_user_idstringRequired
reservednumberRequired
spendnumberRequired
user_idstringRequired
patch/api/v1/end-users
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 End Users

delete

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
external_idstring · min: 1 · nullableOptional

Delete the end user the service names with this user value.

created_beforestring · date-time · nullableOptional

Delete the end users created before this time, oldest first, up to limit of them.

limitinteger · min: 1 · max: 1000Optional

The most end users one call deletes with created_before.

Default: 100
Responses
200

Successful Response

application/json

How many end users a delete removed.

deletedintegerRequired

End users deleted by this call. A page as full as the limit may leave more.

delete/api/v1/end-users
DELETE /api/v1/end-users HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "deleted": 1
}

Get End User

get

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
external_idstringRequired

The id the service names the end user by in a request's user field

Responses
200

Successful Response

application/json

An end user of a service key, addressed by the id the service named it by.

blockedbooleanRequired
budget_idstring · nullableRequired
budget_started_atstring · nullableRequired
created_atstringRequired
current_requestsintegerRequired
current_tokensintegerRequired
external_idstringRequired
next_budget_reset_atstring · nullableRequired
owner_user_idstringRequired
reservednumberRequired
spendnumberRequired
user_idstringRequired
get/api/v1/end-users/{external_id}
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 End User

put

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
external_idstringRequired

The id the service names the end user by in a request's user field

Body

Create an end user ahead of its first request, or move one, onto a budget on the key's list.

budget_idstring · min: 1Required

A budget on the key's end_user_budget_ids

Responses
200

Successful Response

application/json

An end user of a service key, addressed by the id the service named it by.

blockedbooleanRequired
budget_idstring · nullableRequired
budget_started_atstring · nullableRequired
created_atstringRequired
current_requestsintegerRequired
current_tokensintegerRequired
external_idstringRequired
next_budget_reset_atstring · nullableRequired
owner_user_idstringRequired
reservednumberRequired
spendnumberRequired
user_idstringRequired
put/api/v1/end-users/{external_id}
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"
}

Update End User

patch

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
external_idstringRequired

The id the service names the end user by in a request's user field

Body

Block, unblock or move an end user. An omitted field is left as it is.

blockedboolean · nullableOptional

Whether the end user is refused

budget_idstring · min: 1 · nullableOptional

A budget on the key's end_user_budget_ids to move the end user to

Responses
200

Successful Response

application/json

An end user of a service key, addressed by the id the service named it by.

blockedbooleanRequired
budget_idstring · nullableRequired
budget_started_atstring · nullableRequired
created_atstringRequired
current_requestsintegerRequired
current_tokensintegerRequired
external_idstringRequired
next_budget_reset_atstring · nullableRequired
owner_user_idstringRequired
reservednumberRequired
spendnumberRequired
user_idstringRequired
patch/api/v1/end-users/{external_id}
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 End User

delete

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
external_idstringRequired

The id the service names the end user by in a request's user field

Responses
204

Successful Response

No content

delete/api/v1/end-users/{external_id}
DELETE /api/v1/end-users/{external_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*

No content

Last updated

Was this helpful?