API keys
API keys are org-scoped credentials with an operation scope. Outputs are bundled, so keys are never scoped per output. The secret (sk_live_...) is shown once at creation and never again; the key id (key_...) is what listings show.
Scopes: read (list and get endpoints, data, reports, jobs, usage, models, keys), run (stateless inference on the bases), serve (call live endpoints), manage (create endpoints, refresh, upgrade, data connect, sync, pin, generate, cancel jobs, manage keys), delete (remove endpoints and data, revoke keys). Reports are managed on the platform’s Reports page.
{
"id": "key_77ab",
"name": "pipeline-prod",
"key_preview": "sk_liv...a1b2",
"rate_limit": 600,
"requests": 1042,
"scopes": ["serve"],
"created_at": "2026-08-01T10:00:00Z",
"last_used": "2026-08-16T09:12:04Z"
}Attributes
idstringkey_..., immutable.namestringDisplay name, for examplepipeline-prod.key_previewstringFirst and last characters of the secret for recognition, for examplesk_liv...a1b2.scopesarray of stringsAny ofread,run,serve,manage,delete.rate_limitintegerThe key’s request ceiling in requests per minute; the value reflects your plan.requestsintegerRequests made with this key.created_atstringCreation time.last_usedstring | nullLast request time.keystringThe full secret. Present only in the create and rotate responses, shown once.
List keys
/v2/keysLists the organization’s API keys, without secrets.
curl 'https://api.schemalabs.ai/v2/keys' \
-H "Authorization: Bearer $SCHEMA_API_KEY"import os
import requests
SCHEMA_API_KEY = os.environ["SCHEMA_API_KEY"]
r = requests.get(
"https://api.schemalabs.ai/v2/keys",
headers={"Authorization": f"Bearer {SCHEMA_API_KEY}"},
)
r.raise_for_status()
result = r.json()const res = await fetch('https://api.schemalabs.ai/v2/keys', {
headers: {
Authorization: `Bearer ${process.env.SCHEMA_API_KEY}`,
},
});
if (!res.ok) throw new Error(`Schema API error ${res.status}`);
const result = await res.json();{
"keys": [
{
"id": "key_77ab",
"name": "pipeline-prod",
"key_preview": "sk_liv...a1b2",
"rate_limit": 600,
"requests": 1042,
"scopes": ["serve"],
"created_at": "2026-08-01T10:00:00Z",
"last_used": "2026-08-16T09:12:04Z"
},
{
"id": "key_10c2",
"name": "ci",
"key_preview": "sk_liv...2c8e",
"rate_limit": 600,
"requests": 88,
"scopes": ["read", "run", "manage"],
"created_at": "2026-07-20T15:32:00Z",
"last_used": "2026-08-15T22:01:40Z"
}
],
"request_id": "req_8f2c1a"
}Returns
A list of key objects.
Create a key
/v2/keysCreates an API key. The secret is returned once, in this response only.
curl -X POST 'https://api.schemalabs.ai/v2/keys' \
-H "Authorization: Bearer $SCHEMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "pipeline-prod", "scopes": ["serve"] }'import os
import requests
SCHEMA_API_KEY = os.environ["SCHEMA_API_KEY"]
r = requests.post(
"https://api.schemalabs.ai/v2/keys",
headers={"Authorization": f"Bearer {SCHEMA_API_KEY}"},
json={"name": "pipeline-prod", "scopes": ["serve"]},
)
r.raise_for_status()
result = r.json()const res = await fetch('https://api.schemalabs.ai/v2/keys', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SCHEMA_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: "pipeline-prod", scopes: ["serve"] }),
});
if (!res.ok) throw new Error(`Schema API error ${res.status}`);
const result = await res.json();{
"id": "key_77ab",
"name": "pipeline-prod",
"key_preview": "sk_liv...a1b2",
"rate_limit": 600,
"requests": 0,
"scopes": ["serve"],
"created_at": "2026-08-01T10:00:00Z",
"last_used": null,
"key": "<API key secret, shown once>"
}Body application/json
namestringrequiredDisplay name.scopesarray of stringsrequiredOne or more ofread,run,serve,manage,delete.
Returns
The key object including key, the full secret, shown once.
Key and billing management also live on the platform’s API page. Store the secret in a secrets manager; it cannot be retrieved again.
Rotate a key
/v2/keys/:id/rotateIssues a new secret for the key and invalidates the old one immediately. Same id, same scopes.
curl -X POST 'https://api.schemalabs.ai/v2/keys/key_77ab/rotate' \
-H "Authorization: Bearer $SCHEMA_API_KEY"import os
import requests
SCHEMA_API_KEY = os.environ["SCHEMA_API_KEY"]
r = requests.post(
"https://api.schemalabs.ai/v2/keys/key_77ab/rotate",
headers={"Authorization": f"Bearer {SCHEMA_API_KEY}"},
)
r.raise_for_status()
result = r.json()const res = await fetch('https://api.schemalabs.ai/v2/keys/key_77ab/rotate', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SCHEMA_API_KEY}`,
},
});
if (!res.ok) throw new Error(`Schema API error ${res.status}`);
const result = await res.json();{
"id": "key_77ab",
"name": "pipeline-prod",
"key_preview": "sk_liv...9f4d",
"rate_limit": 600,
"requests": 0,
"scopes": ["serve"],
"created_at": "2026-08-01T10:00:00Z",
"last_used": null,
"key": "<new API key secret, shown once>"
}Path parameters
idstringrequiredkey_....
Returns
The key object with the new secret in key, shown once. The old secret stops working immediately.
Revoke a key
/v2/keys/:idRevokes a key immediately. The key stops working and leaves the listing.
curl -X DELETE 'https://api.schemalabs.ai/v2/keys/key_10c2' \
-H "Authorization: Bearer $SCHEMA_API_KEY"import os
import requests
SCHEMA_API_KEY = os.environ["SCHEMA_API_KEY"]
r = requests.delete(
"https://api.schemalabs.ai/v2/keys/key_10c2",
headers={"Authorization": f"Bearer {SCHEMA_API_KEY}"},
)
r.raise_for_status()
print(r.json())const res = await fetch('https://api.schemalabs.ai/v2/keys/key_10c2', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SCHEMA_API_KEY}`,
},
});
if (!res.ok) throw new Error(`Schema API error ${res.status}`);
const result = await res.json();{ "deleted": true, "id": "key_10c2" }Path parameters
idstringrequiredkey_....
Returns
A deletion confirmation.