The base URL is
https://api.aesoteric.ai/v1 for OpenAI clients and https://api.aesoteric.ai for Anthropic clients.
Streaming and non-streaming requests work in every format. A request returns one answer.
Chat Completions
messagesis required and can’t be empty.nmust be 1.- Set the output limit with
max_tokens(ormax_completion_tokens). It can be at most your chosen model’s context size minus the input; a larger value is answered400with the largest value allowed. reasoning_effortsets how much a model reasons. Use a value from that model’sreasoning.supported_efforts, listed in the model catalog.- A stream always ends with a chunk that carries
usage, includingusage.cost. web_search_optionsis answered400: there is no web search.
Messages (Anthropic)
system as text or blocks, images and streaming events work as in Anthropic’s API.
- Send the key as
x-api-keyorAuthorization: Bearer. modelmust be an Aesoteric model id. Claude model names, such asclaude-*, are answered404 not_found_error.max_tokensis required, and can be at most your chosen model’s context size minus the input.thinkingsets the reasoning effort:disabledturns it off,enabledpicks an effort frombudget_tokens(below 1024minimal, below 2048low, below 4096medium, otherwisehigh), andadaptiveusesoutput_config.effortormedium.reasoning_effortalso works and wins overthinking. Reasoning comes back asthinkingcontent blocks.input_tokensexcludes cached input, which is incache_read_input_tokens.cache_creation_input_tokensis always 0.cache_controlis accepted and ignored: caching is automatic. See Prompt caching.- The hosted web search tool (
web_search_*) is answered400, and the whole request is refused. Remove the tool from your request. /v1/messages/batchesis not available.
Count tokens
POST /v1/messages/count_tokens takes the same body without max_tokens and answers {"input_tokens": N}. Counting is free. It has its own per-minute limit, equal to your tier’s requests per minute, so counts never use up your request limit.
Responses
input each time.
store: true,background: true,previous_response_id,conversationandpromptare answered400.store: falseand nostorework, and every answer says"store": false.- Only
POST /v1/responsesis available: retrieving, deleting, cancelling or compacting a response,input_items,input_tokensand WebSocket mode are not. - Tools:
function,customandnamespacetools work. Hosted web search (web_search,web_search_preview) is removed from the request, and atool_choicenaming it becomesauto. Any other hosted tool (mcp,file_search,code_interpreterand others) is answered400. tool_choicecan benone,auto,requiredor a function or custom tool. Anything else,allowed_toolsincluded, is answered400.reasoning.effortsets how much a model reasons. Reasoning comes back as areasoningoutput item; a stream sends it asresponse.reasoning_summary_textevents.- Set the output limit with
max_output_tokens. input_tokensincludes cached input, which is also ininput_tokens_details.cached_tokens.prompt_cache_keyis ignored.- An input too long for the context is answered with the code
context_length_exceeded. A stream that fails after it started ends withresponse.failed, neverresponse.completed.
Usage and cost
Every completed answer reports what it is charged, in USD, ascost in its usage:
cost is absent when nothing is charged, such as for a failed request. See Billing.