Makojima
MAKOJIMA DOCS

Model API Reference

Authentication, endpoints, headers, limits, and safe public responses.

Base Address

https://api.makojima.com

Send one API key or application access token in the Authorization header. The public API is for native and server clients. It does not expose controller, worker, Cloudflare, database-administrator, or GPU-provider credentials.

Endpoints

MethodPathResult
GET/v1/meMinimal verified account identity
GET/v1/modelsModels currently qualified and available to the account
GET/v1/creditsTrial and Premium balances and safe eligibility totals
POST/v1/chat/completionsCreate a text-generation request
GET/v1/requests/{requestId}Read safe status and usage for an owned request
DELETE/v1/requests/{requestId}Cancel eligible owned work

List Models

GET /v1/models accepts optional limit from 1 to 100 and an after UUID. The response is a page with object set to list, data, has_more, and next_after. An empty data array is a successful response.

Each item in data is a model object. Send its id UUID as model when creating a completion. The display name is not the identifier. address is the public name when one exists, or null. The object also includes publisher, upstream attribution, release id and label, text_generation as the supported task, and text input and output modalities.

Limits are nested under limits:

  • model_context_tokens: the model’s absolute limit.
  • qualified_context_tokens: the verified runtime limit.
  • plan_context_tokens: the account plan ceiling.
  • context_tokens: the lowest applicable limit, which is the one to use.
  • max_output_tokens: the output limit inside that context.

The first release returns only qualified text-generation records. It does not imply tools, speech, image, video, adapters, or training support.

Create A Completion

The request must use Content-Type: application/json and include:

Idempotency-Key: <request-uuid>
X-Makojima-Session-Id: <conversation-uuid>

The JSON body requires model and at least one message. Supported message roles are system, user, assistant, and tool. stream is optional. n, when provided, must be 1. max_tokens defaults to 512 and cannot exceed the model and account limits.

The request body is limited to 256 KiB, at most 64 messages, and bounded text, content parts, and tool definitions. Makojima rejects a caller-provided internal cache namespace.

Retry an uncertain request with the same request UUID and identical input. A changed body with the same ID fails rather than charging or running different work. Do not automatically retry paid work under a new ID.

Request Ownership And Cancellation

An account API key can read or cancel API requests owned by that account. An application credential is further limited to requests belonging to that application connection. The same identifiers under another account or app do not grant access.

Safe request status can include the request and attempt IDs, retry relationship, public state, safe failure code, attempt count, and reserved or charged usage. It never includes worker addresses, provider names, images, route credentials, internal prompts, or private diagnostics.

Credits

GET /v1/credits returns exact integer strings:

{
  "object": "credit_balance",
  "unit": "microcredit",
  "unitsPerCredit": "1000000",
  "trialUnits": "1000000000",
  "premiumUnits": "0",
  "processingEligibleUnits": "1000000000",
  "purchaseEligibleUnits": "0",
  "reservedUnits": "0"
}

All credentials for an account share these balances, reservations, and limits. Additional keys or application installations do not multiply available credits or concurrency. Reservations prevent the same balance from funding concurrent work twice. Settlement records actual use once.

Errors

Errors use a stable code inside an error object. Common cases include:

StatusExample CodeMeaning
400invalid_requestThe path, query, JSON, ID, or supported option is invalid.
401invalid_credentialThe Bearer credential is missing, invalid, expired, or revoked. The body is { "error": { "code": "invalid_credential" } }.
404request_not_foundThe request does not exist or this credential cannot see it.
413request_too_largeThe body exceeds the accepted size.
415unsupported_media_typeA completion was not sent as JSON.
429conversation_rate_limitThe account reached the public request fuse.
503control_plane_unavailableAuthorization, catalog, credits, or admission cannot be confirmed safely.

Responses containing account or credential information use private, no-store cache rules. A service failure never causes Makojima to skip ownership, credit, permission, or revocation checks.

On this page