Build once.
Route anywhere.
Instamodel exposes an OpenAI-compatible data plane and a separate control plane for immutable model publishing. This page documents the implemented MVP contract.
Quickstart
Call the deterministic modelrelay/demo route without an account or key. Paid models are unavailable until project funding and usage accounting are enabled.
/v1/chat/completionsOpenAI compatiblecurl https://api.instamodel.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "modelrelay/demo",
"messages": [{"role": "user", "content": "Confirm the gateway is alive"}],
"stream": false
}'The public demo is deterministic and incurs no upstream spend. Every non-demo route still requires bearer authentication; paid traffic remains fail-closed until checkout, balances, and durable ledger posting are connected.
Model IDs & versions
A gateway model ID currently maps to one configured upstream deployment. Paid publisher aliases must additionally snapshot the immutable revision, price, and terms before they are activated.
northstar-demo/clauseguard-32bMoves only through an explicit publish actionnorthstar-demo/clauseguard-32b@2026-08-17.1Stable weights, tokenizer, price, and termsList models through GET /v1/models. Catalog metadata distinguishes platform-verified results from publisher-reported claims.
Routing controls
Instamodel-specific options live under the namespaced routing object, so standard OpenAI clients remain compatible.
{
"model": "northstar-demo/clauseguard-32b",
"routing": {
"strategy": "balanced",
"region": "us",
"zero_retention": true,
"allow_fallback": true
}
}Provider adapters
Adapters translate protocols. The gateway owns routing, request IDs, usage records, canonical errors, and customer-facing SSE.
A provider is production-ready only after streaming, tool-call, Unicode, usage, cancellation, context-limit, and error-mapping conformance tests pass.
Publish a specialist
The browser flow submits to POST /api/publisher/models. Each submission creates a model, an immutable revision, a price version, and a commercial-terms version together. Its agreement digest commits the license identifier, artifact reference, runtime declaration, prices, royalty, and exact attestation version. Private-alpha organizations are quota-limited; validation, deployment, and alias activation remain operator approval gates.
- 01DraftMetadata, license, base model, and task claims
- 02QuarantinedArtifact present but not trusted or executable
- 03ValidatingIntegrity, tokenizer, license, safety, smoke generation
- 04DeployingApproved host receives digest-scoped artifact access
- 05CanaryHealth, latency, output, and metering checks
- 06LiveEligible for routing under the published alias
.safetensors full weights and allowlisted LoRA/PEFT adapters with declarative configs. Pickle, remote code, custom Python, custom kernels, and uploader runtime images are rejected.
Resumable artifact uploads
For large weights, create a multipart upload, send numbered parts of at most 50 MiB with an explicit Content-Length, then complete it with the returned ETags. Bytes land in a private quarantine bucket. Operators must explicitly enable direct uploads; defaults allow three active uploads, 50 GiB per artifact, and 100 GiB of declared artifacts per organization.
/api/publisher/uploadsCreate upload/api/publisher/uploads/:id/parts/:partUpload part/api/publisher/uploads/:id/completeSeal artifactClients declare size and SHA-256 before upload. Completion deletes and rejects an object whose actual size differs; an isolated validator must still independently hash and inspect the object before approval.
Metering & settlement
The paid-release ledger contract allows several provider attempts but exactly one final usage charge. Posted records are immutable and corrections use reversal entries. Automatic posting is still a release gate, so real-provider calls from console keys fail closed by default.
eligible_revenue = cash_backed_usage - refunds - fraud_reversals
owner_royalty = eligible_revenue × royalty_bps / 10,000
host_payable = measured_units × versioned_host_rate
platform_margin = eligible_revenue - owner_royalty - host_payableInference expense is kept separate from the model owner's percentage, so a routing change cannot silently alter creator economics.
Errors & request IDs
Errors use the OpenAI object shape and every response carries x-request-id. Preserve that ID when opening a support issue or reconciling a usage line.
{
"error": {
"message": "No eligible deployment satisfies region=eu.",
"type": "routing_error",
"code": "no_eligible_deployment",
"param": "routing.region"
}
}