plaingateway
API reference

API keys

Inspect the current key and management contract status.

GET /auth/key returns the calling key limit, usage, and budgets. List, create, update, and delete require a management or provisioning key and were not recorded. The gateway README does not give those four request and response shapes, so the contract is missing.

Request

http
GET https://plaingateway.com/api/v1/auth/key
Authorization: Bearer sk-pg-v1-...

Response

http
HTTP/1.1 200
{
  "data": {
    "label": "sk-or-v1-REDACTED...66b",
    "is_management_key": false,
    "is_provisioning_key": false,
    "limit": 50,
    "limit_reset": null,
    "limit_remaining": 49.999164718,
    "include_byok_in_limit": false,
    "budgets": [
      {
        "scope": "key_limit",
        "guardrail_id": null,
        "budget_id": null,
        "limit_usd": 50,
        "spend_usd": 0.000835282,
        "remaining_usd": 49.999164718,
        "reset_interval": null,
        "resets_at": null,
        "include_byok": false
      }
    ],
    "effective_budget": {
      "scope": "key_limit",
      "guardrail_id": null,
      "budget_id": null,
      "limit_usd": 50,
      "spend_usd": 0.000835282,
      "remaining_usd": 49.999164718,
      "reset_interval": null,
      "resets_at": null,
      "include_byok": false
    },
    "usage": 0.000835282,
    "usage_daily": 0.000835282,
    "usage_weekly": 0.000835282,
    "usage_monthly": 0.000835282,
    "byok_usage": 0,
    "byok_usage_daily": 0,
    "byok_usage_weekly": 0,
    "byok_usage_monthly": 0,
    "is_free_tier": false,
    "expires_at": null,
    "creator_user_id": "user_3IzaPSgiBfFyVGbf5eTWJSIZDEU",
    "organization_id": null,
    "workspace_id": "4b871218-f911-581f-adab-89998b54c9c1",
    "allowed_data_regions": [
      "global"
    ],
    "free_model_daily_requests": {
      "used": 1,
      "limit": 1000,
      "remaining": 999
    },
    "rate_limit": {
      "requests": -1,
      "interval": "10s",
      "note": "This field is deprecated and safe to ignore."
    }
  }
}

Management cases

List

request
Management list: path and body undocumented
response
Management list: status and body undocumented

Create

request
Management create: path and body undocumented
response
Management create: status and body undocumented

Update

request
Management update: path and body undocumented
response
Management update: status and body undocumented

Delete

request
Management delete: path and body undocumented
response
Management delete: status and body undocumented