Skip to content
Sign in Create account

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

  • language string
    Length: 2 to 2 characters. Pattern: ^[A-Za-z]{2}$
  • priority string required
    One of: "quality", "speed", "cost", "privacy", "language"
  • use_case string required
    One 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_basis string required

    Basis for the editorial ordering of providers.

    One of: "editorial_matrix_v1"
  • providers array of object required

    Each item:

    • caveats array of string required
    • editorial_score integer required

      Editorial default score; not a measured provider result.

      Range: 0 to 100
    • name string required
    • reason string required
    • recommended_model string or null required
    • score integer required

      Backward-compatible v1 alias for editorial_score.

      Range: 0 to 100
    • score_basis string required

      Basis for the editorial score.

      One of: "editorial_matrix_v1"
    • slug string required
  • use_case string 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

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

429 The request was rate limited. API-generated responses are JSON;

Response headers

  • Retry-After string header

    Seconds to wait before retrying, when provided.

  • X-RateLimit-Scope string header

    Identifies the scope of the request limit, when provided.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string