Graine AI

Get the calling account

Return the account behind this API key.

Return the account behind this API key.

Four fields deserve a word, because each of them is easy to publish wrongly:

  • concurrency.max is min(org_limit, agent_limit). The per-agent level only GATES when it is below the org limit; above that its effective cap is a billion and it is tracking-only.
  • concurrency.enforced is the concurrency_management_enabled feature flag. When it is false the caps are raised to a million internally and nothing blocks, so the numbers above it are informational.
  • concurrency.current is a live read of the exact counter the dial gate consults. If that counter cannot be reached it degrades to 0 rather than failing the request.
  • wallet.balance is derived as allocated minus spent, never read from the stored remaining_usd mirror — that mirror has drifted negative in production and wrongly failed the pre-call credit gate.

Errors: 401 (invalid key), 403 (wrong organization), 429 (rate limited), 503 (the account store is unreachable).

Rate limit: 1000 requests per minute per organization (bucket default). Exceeding it returns 429 with Retry-After; the X-RateLimit-* response headers report your remaining allowance on every call.

GET
/v2/user/me
/v2/user/me

The Authorization access token

Authorization

Authorization
Required
Bearer <token>

Your Graine API key. Create one in the dashboard under Developers, or via POST /v2/api-keys. Send it as Authorization: Bearer <key>.

In: header

Query Parameters

organization_idOrganization Id

Optional. Must equal the API key's own organization; any other value is rejected.

Response Body

200

Identity, plan, concurrency capacity, wallet balance and rate limits.

organization_id
Required
Organization Id

The organization the calling key belongs to.

developer
Required
Developer

Who this key belongs to.

plan
Required
Plan

Commercial plan the organization is on.

rate_limit_tier
Required
Rate Limit Tier

Tier the request ceilings are drawn from.

concurrency
Required
Concurrency

Simultaneous-call capacity, and how much of it is in use.

wallet
Required
Wallet

Prepaid credit balance.

rate_limits
Required
Rate Limits

Request ceilings applied to this organization.

401

1100 — missing, unknown or inactive API key. 1101 — a browser session token was presented instead of an API key.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

403

1102 — the key is valid but lacks the scope this endpoint requires, or names another organization. GET /v2/scopes reports what a key holds.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

422

1001 — the body or query failed validation; the message names the first offending field.

error
Required
integer

Stable integer code from the error table. Branch on this, not on the message.

message
Required
string

One human-readable sentence. Wording may change; the code will not.

429

1300 — the per-organization request rate or concurrent-call limit was reached. Carries Retry-After.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

503

1501 — a service this endpoint depends on is unreachable or returned a 5xx.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

curl -X GET "https://api.graine.ai/v2/user/me?organization_id=string" \
  -H "Authorization: Bearer <token>"

Identity, plan, concurrency capacity, wallet balance and rate limits.

{
  "organization_id": "string",
  "developer": {
    "id": "dev_1a2b3c4d5e6f7a8b",
    "name": "Production integration",
    "key_id": "key_1a2b3c4d5e6f7890",
    "key_preview": "gat_exampleK...6Yc1"
  },
  "plan": "growth",
  "rate_limit_tier": "growth",
  "concurrency": {
    "max": 5,
    "current": 3,
    "agent_max": 5,
    "global_max": 20,
    "enforced": true
  },
  "wallet": {
    "currency": "USD",
    "balance": 912.673829,
    "allocated_total": 1999.5,
    "lifetime_allocated": 1999.5,
    "total_spent": 1086.826171
  },
  "rate_limits": {
    "default_per_minute": 1000,
    "calls_per_minute": 500,
    "executions_per_minute": 500
  }
}