Clarity Llm API
The llm API from Clarity — 3 operation(s) for llm.
The llm API from Clarity — 3 operation(s) for llm.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/onclarity-com:onclarity-com-llm-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Fast Llm API
version: 0.1.0
tags:
- name: LLM
paths:
/api/v1/llm/models:
get:
tags:
- LLM
summary: List Models
description: 'The models each provider offers us, read from the providers'' own lists (cached for 10
minutes), and whether ``/generate`` takes them. A provider whose list cannot be read comes
back with ``error`` set and no models.'
operationId: list_models_api_v1_llm_models_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ModelCatalogResponse'
security:
- HTTPBearer: []
/api/v1/llm/proxy/{provider}/v1/{path}:
get:
tags:
- LLM
summary: Forward to the provider
description: 'Forward to the provider''s ``/v1/`` with our key: OpenAI ``chat/completions``,
``responses``, ``embeddings``, ``models``; Anthropic ``messages``, ``messages/count_tokens``,
``models``. Bodies and streams keep the provider''s shapes. Each model call is recorded with
its tokens and the member; ``X-Voc-Caller``/``-Purpose``/``-Trace-Id`` are recorded too.'
operationId: proxy_api_v1_llm_proxy__provider__v1__path__get
security:
- HTTPBearer: []
parameters:
- name: provider
in: path
required: true
schema:
$ref: '#/components/schemas/src__llm__providers__upstreams__Provider'
- name: path
in: path
required: true
schema:
type: string
title: Path
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
post:
tags:
- LLM
summary: Forward to the provider
description: 'Forward to the provider''s ``/v1/`` with our key: OpenAI ``chat/completions``,
``responses``, ``embeddings``, ``models``; Anthropic ``messages``, ``messages/count_tokens``,
``models``. Bodies and streams keep the provider''s shapes. Each model call is recorded with
its tokens and the member; ``X-Voc-Caller``/``-Purpose``/``-Trace-Id`` are recorded too.'
operationId: postApiV1LlmProxyByProviderV1ByPath
security:
- HTTPBearer: []
parameters:
- name: provider
in: path
required: true
schema:
$ref: '#/components/schemas/src__llm__providers__upstreams__Provider'
- name: path
in: path
required: true
schema:
type: string
title: Path
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
x-operation-id-source: normalized
x-operation-id-original: proxy_api_v1_llm_proxy__provider__v1__path__get
/api/v1/llm/generate:
post:
tags:
- LLM
summary: Generate
description: 'Answer a prompt with JSON that matches the given schema.
The model is the project''s preset (config ``llm.base_model``, default ``chatgpt``); the
call is recorded for accounting.
Example:
```json
{
"prompt": "Group these reviews by root cause.",
"input": [{"id": 1, "text": "The app crashes on login"}],
"schema": {
"type": "object",
"properties": {"groups": {"type": "array", "items": {"type": "string"}}},
"required": ["groups"]
},
"config": {"effort": "low"}
}
```'
operationId: generate_api_v1_llm_generate_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/LlmGenerateRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/LlmGenerateResponse'
'400':
description: invalid_request or provider_rejected
content:
application/json:
schema:
$ref: '#/components/schemas/LlmErrorResponse'
'409':
description: 'model_unavailable: the project''s model preset'
content:
application/json:
schema:
$ref: '#/components/schemas/LlmErrorResponse'
'422':
description: refused or output_truncated (or a malformed body)
content:
application/json:
schema:
$ref: '#/components/schemas/LlmErrorResponse'
'423':
description: The account's demo period has ended
'502':
description: invalid_output or provider_unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/LlmErrorResponse'
'503':
description: provider_busy
content:
application/json:
schema:
$ref: '#/components/schemas/LlmErrorResponse'
'504':
description: timeout
content:
application/json:
schema:
$ref: '#/components/schemas/LlmErrorResponse'
security:
- HTTPBearer: []
components:
schemas:
LlmErrorResponse:
properties:
detail:
$ref: '#/components/schemas/LlmErrorDetail'
type: object
required:
- detail
title: LlmErrorResponse
LlmUsageResponse:
properties:
input_tokens:
type: integer
title: Input Tokens
description: Prompt tokens, cached ones included.
cached_input_tokens:
type: integer
title: Cached Input Tokens
description: Prompt tokens served from the provider's cache.
output_tokens:
type: integer
title: Output Tokens
description: Answer tokens, reasoning ones included.
reasoning_tokens:
type: integer
title: Reasoning Tokens
description: Tokens the model spent reasoning before answering.
type: object
required:
- input_tokens
- cached_input_tokens
- output_tokens
- reasoning_tokens
title: LlmUsageResponse
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
JsonValue: {}
LlmErrorDetail:
properties:
code:
type: string
title: Code
description: invalid_request | provider_rejected | model_unavailable | refused | output_truncated | invalid_output | timeout | provider_busy | provider_unavailable
message:
type: string
title: Message
type: object
required:
- code
- message
title: LlmErrorDetail
src__llm__providers__upstreams__Provider:
type: string
enum:
- openai
- anthropic
title: Provider
ModelCatalogResponse:
properties:
providers:
items:
$ref: '#/components/schemas/ProviderModels'
type: array
title: Providers
type: object
required:
- providers
title: ModelCatalogResponse
LlmGenerateRequest:
properties:
prompt:
type: string
minLength: 1
title: Prompt
description: The task.
system:
anyOf:
- type: string
- type: 'null'
title: System
description: System instructions.
input:
$ref: '#/components/schemas/JsonValue'
description: Data for the task, sent to the model as JSON.
schema:
additionalProperties:
$ref: '#/components/schemas/JsonValue'
type: object
title: Schema
description: 'JSON Schema of the answer, in OpenAI strict mode: the root is an object and every object lists all of its properties in `required` (an optional field is a nullable type).'
model:
anyOf:
- type: string
- type: 'null'
title: Model
description: An OpenAI model id from GET /api/v1/llm/models. Omitted or empty = the project's base model (config llm.base_model) with its preset's defaults.
config:
$ref: '#/components/schemas/OpenAIGenerationConfig'
caller:
anyOf:
- $ref: '#/components/schemas/LlmCaller'
- type: 'null'
additionalProperties: false
type: object
required:
- prompt
- schema
title: LlmGenerateRequest
LlmGenerateResponse:
properties:
data:
additionalProperties:
$ref: '#/components/schemas/JsonValue'
type: object
title: Data
description: The answer, already validated against the schema.
model:
type: string
title: Model
description: The model that answered.
usage:
anyOf:
- $ref: '#/components/schemas/LlmUsageResponse'
- type: 'null'
type: object
required:
- data
- model
title: LlmGenerateResponse
ProviderModels:
properties:
provider:
type: string
title: Provider
generate:
type: boolean
title: Generate
description: Whether POST /api/v1/llm/generate takes this provider's models.
models:
items:
$ref: '#/components/schemas/ModelInfo'
type: array
title: Models
error:
anyOf:
- type: string
- type: 'null'
title: Error
description: Set when the provider's list could not be read.
type: object
required:
- provider
- generate
- models
title: ProviderModels
ModelInfo:
properties:
id:
type: string
title: Id
description: The model id to send as `model`.
display_name:
anyOf:
- type: string
- type: 'null'
title: Display Name
description: Anthropic's display name; OpenAI has none.
created_at:
anyOf:
- type: string
- type: 'null'
title: Created At
description: ISO 8601, as the provider reports it.
owned_by:
anyOf:
- type: string
- type: 'null'
title: Owned By
type: object
required:
- id
title: ModelInfo
LlmCaller:
properties:
surface:
type: string
enum:
- mini_app
- report
- dashboard
- canvas
- cloud_function
title: Surface
ref:
anyOf:
- type: string
maxLength: 200
- type: 'null'
title: Ref
description: Mini-app slug, widget id or cloud function id.
additionalProperties: false
type: object
required:
- surface
title: LlmCaller
description: Where the call comes from, as the host page knows it. Recorded for accounting only.
OpenAIGenerationConfig:
properties:
temperature:
anyOf:
- type: number
maximum: 2.0
minimum: 0.0
- type: 'null'
title: Temperature
description: Sampling temperature. Sent as given; a model that does not take one (gpt-5) rejects it.
effort:
anyOf:
- type: string
enum:
- none
- minimal
- low
- medium
- high
- xhigh
- type: 'null'
title: Effort
description: Reasoning effort. Omitted = the model preset's default. Not every model takes every level.
additionalProperties: false
type: object
title: OpenAIGenerationConfig
description: 'Provider-specific settings. Only OpenAI is called today, so these are OpenAI''s. An
unknown key is refused rather than ignored, so a setting added later never silently
changes what an existing caller gets.'
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
HTTPBasic:
type: http
scheme: basic