Developers API reference

API reference.

Chat completions, models and who-am-I, in the OpenAI format.

Base URL <span data-api-url>https://mayfair-ai.crelloo.workers.dev</span>. All endpoints are under /v1 and need authentication. JSON in, JSON out, except streaming.

Models

idNameVersionTuned for
arloArlo3.2Quick answers and conversation (default)
lucianLucian3.5Hard problem solving
orionOrion3.0Research, OSINT and data analysis
curzonCurzon3.1Design and coding

Omit model to use the default. An unknown model, or one your credential may not use, answers 404 model_not_found.

POST /v1/chat/completions

OpenAI chat completions format.

FieldNotes
modelA public id. Optional: the default model is used when omitted.
messagesRequired, 1 to 200 items. Roles system, developer, user, assistant and tool. Content is a string or a list of {type:"text"} parts. Images are not supported.
streamtrue for server-sent events. stream_options.include_usage adds a final usage chunk.
max_tokens / max_completion_tokensDefault 4096, at most 8000 (higher values are clamped). Also clamped to what is left of a key's token caps.
temperature (0 to 2), top_p (0 to 1), stop (up to 4 strings), seed, presence_penalty, frequency_penaltyPassed through. n must be 1.
tools, tool_choiceFunction tools are passed through and the model's tool_calls come back in the OpenAI shape. Artemii does not run your tools. See Tools.
reasoning_effortlow, medium or high. Some models fix their own level.
userFree text, at most 128 characters, for attribution in the usage report.

Prompt order

The gateway builds one system message. The Artemii identity and voice come first, with the model's own guidance. A short note follows saying the call comes from an application. Your system and developer messages come last. They add to the Artemii blocks and cannot remove or override them. Do not put secrets in them: the system prompt is not a security boundary for your data. Artifact tags are not used over the API; replies are plain Markdown.

Response

JSON
{
  "id": "chatcmpl-...", "object": "chat.completion", "created": 1762257600, "model": "arlo",
  "choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello!" }, "finish_reason": "stop" }],
  "usage": { "prompt_tokens": 120, "completion_tokens": 12, "total_tokens": 132 }
}

finish_reason is stop, length or tool_calls. Every response carries x-request-id: quote it in bug reports.

GET /v1/models and GET /v1/models/{id}

JSON
{
  "object": "list",
  "data": [
    { "id": "arlo", "object": "model", "created": 1762257600, "owned_by": "mayfair", "label": "Arlo", "version": "3.2", "tagline": "...", "description": "..." }
  ]
}

Only models the caller may use are listed. label, version, tagline and description are Mayfair's own wording for each model.

GET /v1/me

Who the credential is and what is left.

  • Person: {object:"me", auth:"user", id, name, email, plan, source:"api:<client>", models, usage:{ day:{pct, remainingPct, resetsAt}, week:{...}, blocked }}. Percentages only, like the Artemii app.
  • Service key: {object:"me", auth:"key", id, name, app, prefix, scopes, models, expiresAt, limits:{rpm, dailyTokens, monthlyTokens}, usage:{ day:{used, limit, remainingPct, resetsAt}, month:{...} }}.

Response headers

  • x-request-id on every response.
  • x-ratelimit-limit-requests and x-ratelimit-remaining-requests for the requests-a-minute bucket.
  • retry-after (seconds) on 429 and 503.

CORS

OPTIONS preflight is answered for origins allowed for user tokens, or listed on any active key. A service-key call from a browser additionally needs its own Origin on that key's list. Responses echo the single allowed origin (never *) and expose retry-after and x-request-id.

Calling it from other languages

Any OpenAI-compatible client works. Set the base URL to <span data-api-url>https://mayfair-ai.crelloo.workers.dev</span>/v1 and use your credential as the API key. See the Quickstart for Python, JavaScript and curl.