Skip to content

The calling key's plan, current-period usage, and keys

GET
/v1/me
curl --request GET \
--url https://api.legesher.io/v1/me

Describe the caller: effective tier, month-to-date usage, key list.

Requires an API key: a caller without one gets the same generic 401 as an invalid key. Key entries carry hash prefixes and lifecycle metadata only; key material is never returned by any endpoint after mint time.

Successful Response

Media type application/json
MeResponse

The caller’s plan, current-period usage, and key metadata.

object
account_subject
required
Account Subject

The billing account this key is bound to, if any. When set, usage_this_period is the account’s shared budget and keys lists every key on the account; otherwise both are per-key.

Any of:
string
keys
required
Keys

Keys in the caller’s scope (the account’s, or just this one).

Array<object>
MeKey

Metadata for one API key in the caller’s scope. Never the key itself.

object
created_at
required
Created At
string format: date-time
is_active
required
Is Active

False once revoked.

boolean
key_hash_prefix
required
Key Hash Prefix

First 12 hex characters of the key’s stored SHA-256 hash: an identifier, not a secret, and not derivable back to the key.

string
last_used
required
Last Used

Last successful authentication with this key, if any.

Any of:
string format: date-time
tier
required
Tier

The plan the key was created on.

string
tier
required
MeTier

The caller’s effective plan: the subscription’s plan when one is active, else the plan the key was created on.

object
id
required
Id

Tier id, e.g. ‘individual’.

string
limits
required
MeTierLimits

The limits of the caller’s plan.

A null value means the plan sets no fixed limit for that measure.

object
api_keys
required
Api Keys

API keys the plan includes.

Any of:
integer
monthly_chars
required
Monthly Chars

Translated characters per UTC month (code points).

Any of:
integer
requests_per_minute
required
Requests Per Minute

Request rate ceiling per minute.

Any of:
integer
name
required
Name

Display name, e.g. ‘Individual’.

string
translation_mode
required
Translation Mode

‘enhanced’ when the plan includes enhanced translation.

string
usage_this_period
required
MeUsage

Billed character usage for the current UTC month.

Reads the same meter the quota is enforced against, so these numbers always agree with the X-Usage-Characters-* response headers. For a key that belongs to an account this is the account’s shared total: every key the account created draws on one budget.

object
chars_remaining
required
Chars Remaining

Budget left this period; null when the budget is unlimited.

Any of:
integer
chars_used
required
Chars Used

Characters billed so far this period.

integer
period_end
required
Period End

End of the window (exclusive): the monthly reset moment.

string format: date-time
period_start
required
Period Start

Start of the UTC month window.

string format: date-time

Example generated

{
"account_subject": "example",
"keys": [
{
"created_at": "2026-04-15T12:00:00Z",
"is_active": true,
"key_hash_prefix": "example",
"last_used": "2026-04-15T12:00:00Z",
"tier": "example"
}
],
"tier": {
"id": "example",
"limits": {
"api_keys": 1,
"monthly_chars": 1,
"requests_per_minute": 1
},
"name": "example",
"translation_mode": "example"
},
"usage_this_period": {
"chars_remaining": 1,
"chars_used": 1,
"period_end": "2026-04-15T12:00:00Z",
"period_start": "2026-04-15T12:00:00Z"
}
}
X-RateLimit-Limit
integer

Requests permitted per minute for the caller’s tier. The X-RateLimit-* set is omitted when the tier’s rate is unlimited, and on a request refused before the caller is identified.

X-RateLimit-Remaining
integer

Requests remaining in the current rate window.

X-RateLimit-Reset
integer

Seconds until the rate limit fully resets.

X-Request-ID
string

Correlation id for this request: the validated inbound X-Request-ID when one was sent, else a server-minted UUID.

X-Usage-Characters-Remaining
integer

Characters left in the caller’s monthly budget.

X-Usage-Characters-Used
integer

Characters billed against the caller’s monthly budget, UTC month to date. The X-Usage-* pair is omitted when the budget is unlimited, and on a request refused before the caller is identified.

The API key is missing or not valid.

Media type application/json
ErrorResponse

Envelope for every error response.

object
error
required
ErrorDetail

Machine-readable code + human message for one error.

object
code
required
Code

Machine-readable error code, e.g. ‘validation_error’, ‘unsupported_language’, ‘language_pack_not_found’, ‘payload_too_large’, ‘foundation_unavailable’, ‘invalid_source_code’, ‘internal_error’.

string
details
Details

Per-field breakdown (validation errors only).

Any of:
Array<object>
FieldIssue

One request-validation problem, stripped of the submitted input.

object
field
required
Field

Dotted location of the offending field.

string
message
required
Message

Human-readable description.

string
type
required
Type

Pydantic error type identifier.

string
message
required
Message

Human-readable explanation.

string

Example generated

{
"error": {
"code": "example",
"details": [
{
"field": "example",
"message": "example",
"type": "example"
}
],
"message": "example"
}
}
X-Request-ID
string

Correlation id for this request: the validated inbound X-Request-ID when one was sent, else a server-minted UUID.

Too many requests.

Media type application/json
ErrorResponse

Envelope for every error response.

object
error
required
ErrorDetail

Machine-readable code + human message for one error.

object
code
required
Code

Machine-readable error code, e.g. ‘validation_error’, ‘unsupported_language’, ‘language_pack_not_found’, ‘payload_too_large’, ‘foundation_unavailable’, ‘invalid_source_code’, ‘internal_error’.

string
details
Details

Per-field breakdown (validation errors only).

Any of:
Array<object>
FieldIssue

One request-validation problem, stripped of the submitted input.

object
field
required
Field

Dotted location of the offending field.

string
message
required
Message

Human-readable description.

string
type
required
Type

Pydantic error type identifier.

string
message
required
Message

Human-readable explanation.

string

Example generated

{
"error": {
"code": "example",
"details": [
{
"field": "example",
"message": "example",
"type": "example"
}
],
"message": "example"
}
}
Retry-After
integer

Seconds to wait before retrying. Usually sent with rate_limited; absent on quota_exceeded, which lasts until the UTC month resets.

X-RateLimit-Limit
integer

Requests permitted per minute for the caller’s tier. The X-RateLimit-* set is omitted when the tier’s rate is unlimited, and on a request refused before the caller is identified.

X-RateLimit-Remaining
integer

Requests remaining in the current rate window.

X-RateLimit-Reset
integer

Seconds until the rate limit fully resets.

X-Request-ID
string

Correlation id for this request: the validated inbound X-Request-ID when one was sent, else a server-minted UUID.

X-Usage-Characters-Remaining
integer

Characters left in the caller’s monthly budget.

X-Usage-Characters-Used
integer

Characters billed against the caller’s monthly budget, UTC month to date. The X-Usage-* pair is omitted when the budget is unlimited, and on a request refused before the caller is identified.