For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DocsAPI ReferenceSDKs
DocsAPI ReferenceSDKs
  • Overview
    • API reference
  • Mesh API
      • POSTChat Completions
      • POSTChat Compare
LogoLogo
Mesh APIChat

Chat Completions

||View as Markdown|
POST
https://api.meshapi.ai/v1/chat/completions
POST
/v1/chat/completions
$curl -X POST https://api.meshapi.ai/v1/chat/completions \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "messages": [
> {
> "role": "user",
> "content": "What'\''s the capital of India?"
> }
> ]
>}'

OpenAI-compatible chat completions endpoint.

Auth: Authorization: Bearer rsk_<ULID> Streaming: set stream=true for SSE chunks Templates: set template=“name” + variables={…} Rate limits: RPM and RPD enforced per key via Redis fixed-window counters Spend cap: enforced if key.spend_cap_usd is set (soft cap)

Was this page helpful?
Previous

API reference

Next

Chat Compare

Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
messageslist of objectsRequired
modelstring or nullOptionalDefaults to openai/gpt-4o
templatestring or nullOptional
variablesmap from strings to strings or nullOptional
session_idstring or nullOptional
streambooleanOptionalDefaults to false
temperaturedouble or nullOptional0-2
max_tokensinteger or nullOptional>=1
top_pdouble or nullOptional0-1
frequency_penaltydouble or nullOptional-2-2
presence_penaltydouble or nullOptional-2-2
stopstring or list of strings or nullOptional
seedinteger or nullOptional
toolslist of objects or nullOptional
tool_choicestring or map from strings to any or nullOptional
transformslist of strings or nullOptional
modelslist of strings or nullOptional
userstring or nullOptional<=256 characters
modalityenum or nullOptional
Allowed values:
imageobject or nullOptional
async_modebooleanOptionalDefaults to false
modalitieslist of enums or nullOptional
Allowed values:
audioobject or nullOptional

Response

Successful Response