Direct request
Direct REST inference requires an enterprise tenant key, end-user token, or managed agent connection. The request body remains the provider’s native schema:X-Locus-Credits-Charged and the remaining balance
from X-Locus-Credits-Balance. Reuse the same idempotency key when retrying an
uncertain outcome.
An OpenAI-compatible alias, POST /api/wrapped/credits/v1/chat/completions,
serves the same metered endpoint (JSON and SSE), so OpenAI client libraries can
point their base URL at Locus without a request rewrite.
Agent and framework access
For a Personal account, connect the client through MCP OAuth and use the inference tools enabled under Tools. For an enterprise headless runtime, create anlcac_… agent connection that permits only the intended inference
endpoints. Then use the hosted MCP URL from Connect an
agent or one of the framework
recipes. MCP tool calls reject stream: true; enterprise
clients that need SSE must use the REST paths above. Never put the tenant secret
key into a model provider or agent runtime.
Dynamic charges and streaming
For Locus Pro calls, the selected model and request body resolve the charge before dispatch. Locus reserves that amount and captures the same quoted amount when the upstream accepts the billable call; it does not recalculate the debit from final provider token usage. Non-streaming failures before success release the reservation. Streaming responses preserve the provider’s event stream and capture after upstream acceptance but before the first response byte, so a later client disconnect or stream failure remains charged.Tools and pricing
Enable endpoints and inspect exact or live-quoted pricing.
SDK reference
Call inference directly from a server application.