Recommend a provider/model for a use-case
POST /api/recommend
Returns CloakAPI editorial provider defaults for the requested use case, priority, and optional ISO 639-1 language. Scores and ordering are editorial choices, not measurements of provider quality, latency, price, or privacy. This is a recommendation response, not a provider-routing call; invalid enum values or a malformed language code return 422.
Authenticate with a portal session token.
Request body
application/json object
languagestringLength: 2 to 2 characters. Pattern:^[A-Za-z]{2}$prioritystring requiredOne of:"quality","speed","cost","privacy","language"use_casestring requiredOne of:"long_docs","code_generation","creative_writing","realtime","privacy","cost","norwegian","general"
Example
{
"language": "en",
"priority": "quality",
"use_case": "code_generation"
}Responses
200 Editorial provider recommendations; scores and order are not measured results.
application/json object
ordering_basisstring requiredBasis for the editorial ordering of providers.
One of:"editorial_matrix_v1"providersarray of object requiredEach item:
caveatsarray of string requirededitorial_scoreinteger requiredEditorial default score; not a measured provider result.
Range: 0 to 100namestring requiredreasonstring requiredrecommended_modelstring or null requiredscoreinteger requiredBackward-compatible v1 alias for editorial_score.
Range: 0 to 100score_basisstring requiredBasis for the editorial score.
One of:"editorial_matrix_v1"slugstring required
use_casestring required
Generated sample
{
"ordering_basis": "editorial_matrix_v1",
"providers": [
{
"caveats": [
"string"
],
"editorial_score": 0,
"name": "string",
"reason": "string",
"recommended_model": "string",
"score": 0,
"score_basis": "editorial_matrix_v1",
"slug": "string"
}
],
"use_case": "string"
}401 Missing or invalid bearer token.
application/json object
Any keys are accepted.
403 The caller does not meet the route requirements: accepted Terms of Service and Privacy Policy.
application/json object
Any keys are accepted.
422 Invalid use case, priority, or language.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
429 The request was rate limited. API-generated responses are JSON;
Response headers
Retry-Afterstring headerSeconds to wait before retrying, when provided.
X-RateLimit-Scopestring headerIdentifies the scope of the request limit, when provided.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
text/html string