Gateway

Create a new API key

Creates a new API key in the authenticated workspace. Management API key required.

post/keys

Request

  • Base URL: https://api.phaseo.app/v1
  • URL: https://api.phaseo.app/v1/keys
  • Auth: HTTP bearer

Request body

namestring required
workspace_idstring uuid

Optional workspace override for internal callers.

limitnumber nullable

Optional spend limit in USD for this key.

limit_reset'daily' | 'weekly' | 'monthly'

Period used for the spend limit window.

include_byok_in_limitboolean

Accepted for compatibility. Current Phaseo behavior always excludes BYOK from this limit field.

expires_atstring date-time nullable
disabledboolean
soft_blockedboolean
department_idstring uuid nullable

Department this key belongs to for department rate limits and budgets. Null means the key counts only toward workspace-wide limits.

Example request

{
  "name": "Analytics Service Key",
  "scopes": "[\"chat.completions\",\"responses\"]"
}

Response

API key created

Example response

{
  "data": {
    "id": "11111111-1111-4111-8111-111111111111",
    "hash": "a3f5b7c9d8e1f23456789abcdeffedcba9876543210fedcba1234567890abcdef",
    "workspace_id": "22222222-2222-4222-8222-222222222222",
    "name": "Analytics Service Key",
    "label": "Analytics Service Key",
    "prefix": "phaseo_v1_sk_abcd1234",
    "status": "active",
    "scopes": "[\"chat.completions\",\"responses\"]",
    "created_by": "user_abc123",
    "created_at": "2026-04-28T12:00:00Z",
    "updated_at": "2026-04-28T12:15:00Z",
    "last_used_at": "2026-04-28T12:30:00Z",
    "expires_at": "2027-12-31T23:59:59Z",
    "key": "phaseo_v1_sk_abcd1234_supersecretvalue"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.