Skip to main content

TypeAlias.ProblemDetails

type ProblemDetails = z.infer<typeof problemDetailsSchema>;

RFC 7807 Problem Details for HTTP APIs.

A machine-readable format for specifying errors in HTTP API responses. Standardizes error responses across the Keyban API with consistent structure.

All fields except detail are optional but recommended for clarity. The detail field contains the primary human-readable error message.

See

Example

// Parsing error responses from the API
const response = await fetch('/v1/llm/chat/completions', {
method: 'POST',
body: JSON.stringify({ model: 'gemini-2.5-flash-lite', messages: [] })
});

if (!response.ok) {
const error: ProblemDetails = await response.json();
console.error(error.detail); // "Invalid request: The 'messages' field must contain at least one message."
console.log(error.status); // 400
console.log(error.title); // "Bad Request"
}