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/extract-product-from-url', {
method: 'POST',
body: JSON.stringify({ url: 'https://example.com' })
});
if (!response.ok) {
const error: ProblemDetails = await response.json();
console.error(error.detail); // "Access denied: The website blocked our request..."
console.log(error.status); // 400
console.log(error.title); // "Bad Request"
}