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
Create an API key in the console, then call any enabled model through the OpenAI-compatible endpoint. Use GET /v1/models with the same key to discover available IDs.
/v1/chat/completionsOpenAI compatiblecurl https://api.instamodel.ai/v1/chat/completions \
-H "Authorization: Bearer $INSTAMODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "'"$INSTAMODEL_MODEL_ID"'",
"messages": [{"role": "user", "content": "Hello"}],
"stream": false
}'Prepaid project keys currently accept non-streaming text requests only. Requests with stream: true fail before provider dispatch.
Keys are shown once, stored as one-way hashes, and can be revoked from the console. Keep keys server-side and never expose them in browser bundles.
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.
publisher/model-nameMoves only through an explicit publish actionpublisher/model-name@revisionStable 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": "publisher/model-name",
"routing": {
"strategy": "balanced",
"region": "us",
"zero_retention": true,
"allow_fallback": true
}
}Provider adapters
Adapters translate provider protocols. The gateway owns routing, request IDs, usage records, and canonical errors. Some operational routes support SSE internally, but prepaid project keys remain non-streaming in this MVP.
Streaming is not activated for prepaid project keys. Before any future activation, a provider must pass streaming, tool-call, Unicode, usage, cancellation, context-limit, and error-mapping conformance tests.
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. 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.
Artifact sources
Submit an immutable Hugging Face or S3-compatible artifact reference with its SHA-256 digest. Direct browser uploads are not accepted in this build: all /api/publisher/uploads routes fail closed until private Blob ingestion and an isolated scanning pipeline are deployed.
/api/publisher/modelsRecord artifact referenceAn operator must independently verify the digest, license, runtime compatibility, and smoke-generation evidence before a revision can be activated. Pickle, remote code, custom Python, custom kernels, and uploader-provided runtime images are outside the trust boundary.
Metering & settlement
Console API keys use prepaid credit. Instamodel reserves the maximum token cost before dispatch, requires consistent terminal usage, and finalizes the measured charge before returning a paid response. For activated post-trained models, the wallet charge, request, attempt, token usage, and balanced royalty journal post atomically. Missing pricing, unsupported billable features, incomplete usage, or an ambiguous financial result fails closed.
gross_usage_charge = measured tokens × versioned retail rates
provisional_owner_accrual = gross_usage_charge × royalty_bps / 10,000
host_cost_entry = measured_units × versioned_host_rate
platform_entry = gross_usage_charge - owner_accrual - host_costInference expense is kept separate from the model owner's percentage, so a routing change cannot silently alter creator economics. Purchase-level refunds and disputes are not yet attributed to usage entries, so every publisher figure is provisional rather than cash-backed, net, payable, or payout-ready. Statement closing and cash payouts are disabled.
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"
}
}