프로젝트 API 키 생성
Management key required. 프로젝트에 연결된 모델 API 키를 생성합니다. 키는 한 번만 반환됩니다.
URL의 api_key_id는 모델 API 키 생성(POST /public/v1/api-keys) 응답의 id이며, 형식은 ak_...입니다. 비활성화, 삭제, 한도 설정, 사용량 조회에 필요하므로 저장하세요. 응답의 key(apikey-...)는 모델 호출용이며, 관리 호출의 인증 헤더에는 계속 mgmt-...를 사용합니다.
Management key required. Use a Management API Key (mgmt-...) for your Team, created by a Team Owner.
Create a model API key (apikey-...) bound to the specified active project. This returns a model key, not another management key. The model key owner is the current Team Owner. Existing account, project and member spending rules apply; this endpoint does not set an additional key-level allowance.
Save both fields from the successful creation response: id is the stable ak_... identifier to use as {api_key_id} in the disable, delete, allowance and usage URLs. The JSON field is named id. The key field is the apikey-... secret for model calls and is returned only once. Management calls continue to use mgmt-... in the authorization header.
For example, an id of ak_0123456789ABCDEFGHIJKL gives the usage URL /public/v1/api-keys/ak_0123456789ABCDEFGHIJKL/usage. The Public API currently has no key list endpoint; save id when creating the key.
Key names must be unique among non-deleted keys in the account. Retrying with the same name returns 409 and does not recover the original secret. There is currently no fixed per-account or per-project key count limit. Request rate limits still apply.
Authorization
ManagementKeyBearer Management key required. Send Authorization: Bearer mgmt-....
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/public/v1/api-keys" \ -H "Content-Type: application/json" \ -d '{ "name": "customer-123-primary", "project_id": "019a6eab-7c00-7000-8000-000000000123" }'{ "object": "api_key", "id": "ak_0123456789ABCDEFGHIJKL", "name": "customer-123-primary", "project_id": "019a6eab-7c00-7000-8000-000000000123", "key": "apikey-REPLACE_WITH_SECRET_RETURNED_ONCE", "redacted": "apikey-xxxx********xxxx", "enabled": true, "created_at": "2026-11-11T00:00:00Z", "expires_at": null, "request_id": "req_example"}Last updated on