API reference
Create an API key
/v1/api-keys Creates a scoped credential and returns its secret once.
- Authentication
- Send an API key or a service-account access token as a Bearer token.
Request body
PublicCreateApiKeyRequest
Stable public input for issuing a user-owned API key.
expirationnull | ApiKeyExpirationOptionalexpires_in_daysinteger | nullOptionalRequested lifetime in days; omission of both this field and `expiration` selects 90 days. It cannot be combined with `expiration`.
Default90
Minimum1
Maximum365
monthly_spend_limit_microusdinteger | nullOptionalOptional positive monthly spend ceiling in millionths of a US dollar.
Minimum1
namestringRequiredHuman-readable key name.
Minimum length1
Maximum length100
permissionsPublicApiKeyPermission[]RequiredNonempty grants bounded by the caller's current effective permissions.
Minimum items1
Responses
- 201
Key created; the secret is present only in this response.
PublicCreatedApiKeyX-Request-ID - 400
Invalid request.
PublicApiErrorX-Request-ID - 401
Authentication required.
PublicApiErrorX-Request-ID - 403
Requested permissions exceed current authority.
PublicApiErrorX-Request-ID - 409
The account is unavailable or its active-key quota is exhausted.
PublicApiErrorX-Request-ID
PublicCreatedApiKey
Public metadata for a newly issued API key.
created_atstringRequiredCreation timestamp in UTC.
display_prefixstringRequiredNon-secret prefix used to identify the key.
expires_atstring | nullRequiredExpiry timestamp in UTC, null for a key that never expires.
idstringRequiredStable credential id used for revocation.
namestringRequiredUser-provided display name.
secretstringRequiredPlaintext secret present only in the creation response.
Schemas
ApiKeyExpiration
A named API-key lifetime: one day, one week, one month (30 days), one year (365 days), or a key that never expires.
1d7d30d365dnever
ErrorCode
Machine-readable product API failure.
unauthenticatedforbiddeninvalid_requestnot_foundconflictpayment_requiredtoo_many_requestsupstreaminternal
ErrorRecovery
Browser-safe recovery action selected by the authoritative product boundary.
| Variant | Type |
|---|---|
| 1 | object |
| 2 | object |
PublicApiError
Stable public error envelope for APIs whose reason vocabulary is extensible.
codeErrorCodeRequiredClosed status category suitable for program control flow.
Allowedunauthenticatedforbiddeninvalid_requestnot_foundconflictpayment_requiredtoo_many_requestsupstreaminternal
messagestringRequiredSafe diagnostic intended for operators, not program branching.
reasonstringRequiredExtensible machine-readable detail; clients must accept unknown values.
recoverynull | ErrorRecoveryOptionalrequest_idstring | nullOptionalThe request reference, equal to the response's `X-Request-ID`; quote it to support.
validationnull | ValidationReportOptional
PublicApiKeyPermission
Stable permission names accepted by the public API-key endpoint.
search-readkeys-create-ownkeys-manage-own
ValidationIssue
One actionable, privacy-safe contract violation.
allowed_valuesarray | nullOptionalMaximum items16
codestringRequiredStable, extensible machine-readable category.
Maximum length64
pathstringRequiredRFC 6901 pointer to the rejected location; empty means the root value.
Maximum length1024
suggestionstringRequiredCode-owned instruction for correcting the request.
Maximum length512
ValidationReport
Bounded validation feedback shared by model, REST, and MCP boundaries.
contractstringRequiredStable contract name, normally the published schema component name.
Maximum length128
issuesValidationIssue[]RequiredAt most eight deterministic violations. Correct every issue before retrying.
Maximum items8
truncatedbooleanRequiredWhether more violations were omitted; retry after correcting the listed issues.
curl --request POST "https://platform.yep.com/api/v1/api-keys" \
--header "Authorization: Bearer $YEP_API_KEY" \
--header "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"name": "string",
"permissions": [
"search-read"
]
}
JSON {
"created_at": "string",
"display_prefix": "string",
"expires_at": "string",
"id": "string",
"name": "string",
"secret": "string"
}