For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Get Started
    • Introduction
    • Quickstart
    • Authentication
  • API Reference
      • GETList Api Keys
      • POSTCreate Api Key
      • GETGet Api Key
      • DELDelete Api Key
      • PATCHUpdate Api Key
      • PATCHRotate Api Key
  • Python SDK
    • Install
    • Usage
    • Errors
  • CLI
    • Overview
LogoLogo
API Referenceapi-keys

Create Api Key

POST
/api/v1/api-keys
POST
/api/v1/api-keys
$curl -X POST https://api.onepin.ai/api/v1/api-keys \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "Production API Key"
>}'
1{
2 "data": {
3 "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
4 "workspace_id": "a3f1c2d4-5b6e-4f7a-9c8d-123456789abc",
5 "created_by": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
6 "name": "Production API Key",
7 "key_type": "live",
8 "key_prefix": "pk_live_",
9 "key_suffix": "9f8e7d6c",
10 "scopes": [
11 "workflows:read",
12 "workflows:run",
13 "voices:read"
14 ],
15 "active": true,
16 "last_used_at": "2024-04-20T14:22:00Z",
17 "rate_limit_per_min": 1000,
18 "revoked_at": "null",
19 "created_at": "2024-04-15T09:30:00Z",
20 "updated_at": "2024-04-15T09:30:00Z",
21 "api_key": "pk_live_9f8e7d6c3b2a1d0e",
22 "preview": "pk_live_9f8e7d6c"
23 },
24 "meta": {
25 "request_id": "7e57d004-2b97-0e7a-b45f-5387367791cd",
26 "timestamp": "2024-04-15T09:30:00Z"
27 }
28}
Create a live API key and return its plaintext value exactly once.
Was this page helpful?
Previous

Get Api Key

Next
Built with

Authentication

AuthorizationBearer
Clerk JWT token

Headers

X-Workspace-Idstring or nullOptional

Request

This endpoint expects an object.
namestringRequired1-120 characters
scopeslist of enumsOptional
rate_limit_per_mininteger or nullOptional
key_typestringOptionalDefaults to live

Phase 1 supports live bearer keys only; test/public are reserved.

Response

Successful Response
dataobject
metaobject

Errors

422
Unprocessable Entity Error