# From a thought to a useful result.

Noemad brings models, wallet identity, usage pricing, and Monad settlement into one workspace.

Monad Testnet release. Live wallet sessions, API keys and one qualified chat route are connected. Sample mode remains available. Public wallet-payment acceptance and broader model qualification are tracked separately.

## One interface, multiple providers

Noemad connects a wallet-owned account to model capabilities through a modular Go gateway. Provider credentials and routing stay on the server. Users approve a spending maximum for each paid operation; the service settles the measured actual charge on Monad.

Quickstart

Run your first testnet request.

Model catalog

Discover capability reference data.

Workspace

Keys, usage, logs and billing.

Payments

Maximum approval, actual settlement.

## Product surfaces

SurfacePurposePlaygroundChat, media, realtime, retrieval and evaluation interfacesModel catalog and calculatorCapabilities, unit-specific rates and request estimatesWorkspaceWallet-owned keys, usage, logs and receiptsOperator consoleSeparate operational interface previewStatus and changelogMonitoring states and development notes

## Current implementation

The dashboard connects wallet sign-in, product keys, qualified chat, usage and receipts to the Go gateway. Other modalities and the operator console remain previews. Read the implementation status and the project repository.

---

# Your first request

Choose a capability, review a maximum, and keep the result with its receipt.

## 1. Open your workspace

Start in the dashboard, playground, or capability playground. Live mode uses the server catalog. The Sample data switch opens local examples.

## 2. Connect your wallet

Choose Connect wallet and select an installed EVM wallet. Connection shares your selected address. Choose Sign in with wallet to approve a separate SIWE challenge. Select Monad Testnet for payments; the wallet needs testnet USDC and MON for its initial token approval.

## 3. Choose a model and limits

Inspect the model capability, input type, output limit and applicable unit. The live gateway snapshots the billing policy and maximum for this request. The browser calculator is a reference, not the authority for a payment.

## 4. Review the maximum

Review the model, maximum, testnet token, merchant, expiry and rounding policy. If needed, approve a bounded USDC allowance, then authorize this inference separately. Network fees are separate. Signing in does not grant permission to pay.

## 5. Read the result and receipt

After authorization, the gateway can stream the output. Reliable usage determines the actual charge within your cap. Settlement status is retrieved separately; output success and confirmed payment are different states.

## Try it now

Open the live playground. The current chat route has a 0.01 testnet USDC maximum and a 512-token output limit. Its actual charge follows the supplier bill. Sample mode signs and transfers nothing.

## Next steps

Wallet & sign-in

Connect an address and understand each permission.

API reference

Explore request formats and capability guides.

Monad payments

Review your maximum, usage and settlement.

---

# Your wallet is your identity

Wallet connection, sign-in, and spending authorization are separate permissions.

## Connect an installed wallet

The UI uses EIP-6963 discovery with an EIP-1193 injected-provider fallback. Address access is requested only after you choose a wallet. Private keys and recovery phrases are never requested.

Mobile wallets must expose an injected provider in their in-app browser. WalletConnect QR pairing is not connected in this preview.

## Verify ownership

The server validates the SIWE challenge, domain, URI, chain, nonce, time and origin. Nonces are single-use. Sessions use Secure, HttpOnly, SameSite cookies and CSRF protection. Reload recovers the same session-bound CSRF token; sign-out revokes the session. Contract-wallet support must be qualified before it is advertised.

```
POST /_monad/v1/auth/challenge
POST /_monad/v1/auth/verify
```

## Wallet-owned API keys

Product keys belong to the wallet account and scope access to its own requests, files, jobs and usage. They are not provider credentials and do not automatically authorize wallet spending.

## Authorize a bounded request

The x402 v2 upto flow uses the pinned SDK’s Permit2/proxy mechanism. Allowance and request authorization are reviewed separately when needed. The signed maximum limits collection; it does not reserve wallet funds.

## Account changes

Disconnect or account changes clear the live wallet data and revoke the previous session. Each inference needs an explicit payment authorization. Manage wallet site permissions and remaining token allowance inside your wallet.

---

# Models, streams, and capabilities

A qualified model route keeps its request contract while adding explicit payment terms.

## Choose a qualified route

The product plan preserves familiar Chat Completions, Responses and Messages payloads and streams. Media, files, jobs, realtime, embeddings, rerank and structured evaluation retain their own contracts when enabled.

```
{
  "model": "<qualified-model-id>",
  "messages": [
    {
      "role": "user",
      "content": "Turn this product brief into a clear summary."
    }
  ],
  "max_completion_tokens": 512,
  "stream": true
}
```

## Bind the quote

The quote binds the owner, method, path, canonical body, provider, model, rate snapshot, limits, maximum, asset, chain, recipient and expiry. Changing the model or cost-relevant inputs requires a new quote.

## Stream without losing payment state

Output can begin after authorization verification. The gateway forwards the qualified protocol’s JSON/SSE and records usage and outcome. Final settlement is retrieved separately; the initial stream headers cannot be updated after delivery begins.

## Validate usage and outcome

A successful HTTP status alone does not prove a usable response or billable usage. Missing final usage, a partial stream, a timeout after dispatch, or a crashed worker enters the applicable recovery or reconciliation state.

## Provider modularity

Each adapter implements capability discovery, pricing, invocation, usage mapping and health. A different provider/model/rate cannot silently replace approved terms. See provider architecture.

---

# Approve a maximum. Pay for usage.

The x402 v2 upto flow separates authorization from actual settlement.

## Review a model-specific quote

There is no user app balance to top up. Pricing comes from the selected model and parameters. The gateway freezes the rate snapshot, unit, modifiers, conversion policy, limits and expiry for the operation.

FieldMeaningMaximumAn enforceable upper bound you approve before dispatchActual amountCalculated from reliable request usage and the frozen rateNetworkMonad; chain, token, proxy and facilitator must come from verified configurationMechanismx402 v2 upto, using the pinned Permit2/proxy implementationNetwork feeSeparate from inference; sponsorship must be verifiedCurrent chat routeLive chat maximum: 0.01 testnet USDC. The actual amount remains pending until the supplier bill is resolved.

## The request lifecycle

Validate the capability, capacity and model rate.

Create an immutable quote and return a payment challenge.

Review the quote and any required allowance.

Sign the bounded request authorization in the wallet.

Verify and claim one operation before dispatch.

Forward output and record reliable usage.

Persist the actual amount and unique settlement job.

Verify the matching onchain receipt before marking collection settled.

## The unused amount stays in your wallet

The maximum is not transferred first. Settling less than the maximum leaves the difference in your wallet; it is not a refund. Authorization also does not lock your balance, so later collection can fail.

## Metering and rounding

Chat separates ordinary input, cache-read and output under the model’s usage definition. Media uses its actual units. Money uses integer/fixed-point values. Current policy converts 100,000,000 nominal Amanai credits to 1 USDC and rounds the final request charge up once to 0.000001 USDC. The platform fee is zero. The supplier bill already incorporates model and cache pricing; the gateway does not charge cache twice.

## Uncertainty and zero charge

Missing usage is not permission to charge the maximum. Reconcile uncertain outcomes. A free or rounded-zero operation closes as zero-charge without inventing a transaction. Poll the existing operation; the gateway reconciles uncertain settlement and does not blindly send a second payment.

## Implementation status

The backend has a recorded testnet wallet payment below its cap. The public dashboard uses the SDK checked against the Go verifier; acceptance of a new signed request through this deployed UI is tracked separately. Other models, mainnet and media payments are not enabled.

Protocol references: Monad x402 guide and EVM upto specification.

---

# Application and inference API

Familiar inference contracts with explicit wallet and payment extensions.

Runtime v1.2. The public API shares this origin. Only qualified routes from /calculate/models are enabled. The current live model is amanai/gpt-6-luna for Chat Completions.

## Endpoint directory

Chat

Messages, Responses and tools.

Media

Image, video and speech requests.

Realtime

Live WebRTC voice sessions.

Embeddings

Text vectors and bounded batches.

Rerank

Query and document relevance.

Evaluation

Typed answers from state and questions.

## Public surfaces

SurfaceContract/v1/chat/completions, /v1/responses, /v1/messagesProduct key or supported playground session; qualified reference JSON/SSE/v1/models and /v1/usageQualified catalog and owner-scoped usageFiles, jobs and modality routesOriginal resource contract with product ownership checks/_monad/v1/auth/challenge and /_monad/v1/auth/verifyWallet challenge and verificationGET /_monad/v1/operations/{id}Owner-only inference and collection status

## Payment headers

```
PAYMENT-REQUIRED
PAYMENT-SIGNATURE
PAYMENT-RESPONSE
Idempotency-Key
X-Monad-Operation-Id
```

The Idempotency-Key binds a credential, route and request body to one operation. A payment-aware client preserves the exact key and body when submitting authorization. Generic clients do not automatically understand this extension. Final payment status may arrive after streaming, through the owner-only receipt endpoint.

## Request example

```
POST /v1/chat/completions
Authorization: Bearer <product-api-key>
Content-Type: application/json
Idempotency-Key: <unique-request-key>
PAYMENT-SIGNATURE: <bounded-authorization>

{
  "model": "<qualified-model>",
  "messages": [
    {
      "role": "user",
      "content": "Summarize this brief."
    }
  ],
  "max_completion_tokens": 512,
  "stream": true
}
```

## Ownership and retries

One chain/token/payer/nonce/spender tuple binds to one operation. Scope idempotency to owner, route and canonical body. Repeated proof reads existing state rather than dispatching a second request. Shared provider accounts never expose another wallet’s resources.

## Compatibility directory

API compatibility

Shared headers, errors and request lifecycle.

SDK & CLI

Configure clients and payment-aware tools.

Reseller API

Operator procurement and provider orders.

---

# Keep inference and payment distinct

A result, a usage record, and a collection receipt describe different parts of one operation.

## Separate state machines

```
Operation: quoted → authorized → dispatched → streaming / completed / failed / unknown
Collection: none → authorized → ready → settling → settled / zero_charge / unknown / failed
```

## What a receipt must contain

Record the owner, quote, model, rate snapshot, limits, usage, maximum, actual amount, asset, chain, recipient, operation outcome and collection state. Include a transaction hash only after an actual transaction has been observed and verified.

## Recover without dispatching again

Retrieve the existing operation or result. A payment timeout does not mean inference should be rerun. Settlement retries reuse the immutable actual amount and authorization binding. Reconciliation verifies the matching receipt, spender, nonce, payer and recipient.

## Ambiguous or partial results

Partial billable delivery follows the frozen policy when usage is reliable. Missing usage or ambiguous dispatch requires reconciliation. Do not silently fall back to a different provider, replay a side effect, or charge a guessed maximum.

## Local demo receipts

Preview receipts are saved only in this browser. They contain sample usage and pricing, no real signature or transaction hash. Download them to keep a copy; clearing browser storage removes them.

---

# One product. Modular providers.

A Go gateway connects wallet identity, capability adapters, metering, and Monad settlement.

## Request topology

```
Browser / SDK + user wallet
          │ session or product key + bounded authorization
          ▼
Go gateway ─── provider adapter ─── model API
    │                 │ output + usage
    ├── PostgreSQL: quotes, operations, usage, journals
    └── Settlement workers → x402 facilitator → Monad
               │
               └── verified receipt / reconciliation
```

## Clear module boundaries

Identity, catalog, quotes, operations, usage, accounting, payment and reconciliation have separate responsibilities. Adapters implement provider formats and qualified capabilities behind ports. A new provider does not replace the wallet/payment core.

## Durable accounting

Persist usage, outcome, immutable charge and unique settlement job atomically. Workers use leases and fencing. Provider and RPC network calls happen outside database transactions. Keep anti-replay proof and accounting journals beyond content retention.

## No user deposits

The operator funds provider accounts. The user holds their own Monad tokens and authorizes a request maximum. Authorization does not reserve funds, so the operator must bound outstanding collection liability.

## Implementation reference

The architecture, payment design, and protocol remain implementation specifications.

---

# Know where your data goes

Wallet identity, offchain requests, onchain settlement, and local preview storage.

## Local preview data

Demo prompts, receipts and workspace fixtures are saved in this browser. Theme and motion preferences are also local. Local samples do not call a model or submit payments. A wallet connection can contact your installed wallet after an explicit choice.

## Live request processing

The service and selected model provider process prompts and outputs offchain. The gateway does not need to forward wallet session cookies, payment signatures or private keys to the model provider.

## Public blockchain information

Wallet addresses and settlement transactions are publicly linkable. Pseudonymous wallet access is not anonymity. Prompts should not be placed in onchain transaction metadata.

## Ownership and retention

The gateway must scope keys, usage, files, jobs and artifacts to the product owner even when it uses a shared provider account. Retention periods and provider policies require confirmation before launch; this preview does not promise zero retention or no training.

## Trust pages

See the trust center, privacy outline, and browser storage notice.

---

# What is connected

Live testnet capabilities and the remaining acceptance gates.

## Available to explore

Responsive landing, original classical artwork, animations, dark/light mode.

Wallet discovery/address connection and wallet-only entry screens.

Local Playground walkthrough, sample receipts, search/copy/download.

Public catalog, status, changelog, policy, and detailed capability docs.

Separate personal dashboard built with shadcn/ui: overview, playground, calculator, logs, usage, payments, rewards, billing, and API keys. Operator and multimodal lab previews remain separate.

## Connected on testnet

Wallet SIWE sessions, reload recovery, and scoped API keys.

Qualified Chat Completions through Amanai, with JSON and SSE support.

Explicit bounded Permit2 approval and per-request authorization.

Owner-scoped operation history, supplier billing and settlement status.

Go API, PostgreSQL and encrypted result storage behind a dedicated Cloudflare tunnel.

## Remaining acceptance

The backend has a confirmed testnet payment; the deployed dashboard still needs its own signed wallet canary. Media, all-model qualification, refunds, mainnet, monitoring and disaster recovery are separate gates. Sample mode and the operator console remain illustrative.

## Service health is separate

The service status page represents telemetry readiness. It does not report invented uptime or treat absent monitoring as an outage.

## Latest product scope

The current specification replaces the earlier single-profile fixed-price concept with model-specific usage pricing and modular providers. Only Sample mode is illustrative. Live mode uses the deployed gateway and requires explicit wallet consent for payments.

---

# Provider architecture

One product contract, several qualified inference adapters.

Implementation target. This guide specifies the intended product surface. The current frontend uses local samples; it does not call an inference service or collect funds. An endpoint is enabled only after its adapter, ownership, usage, and payment behavior are qualified.

## Product core and provider adapters

Noemad owns wallet identity, product API keys, model discovery, immutable quotes, payment authorization, usage attribution, receipts, and recovery. A provider adapter owns authentication to a model service, native request conversion, stream parsing, usage normalization, and safe error mapping.

The product is designed for all qualified models and modalities. Adding a provider is more than changing a base URL: authentication, content blocks, reasoning controls, tool semantics, asynchronous jobs, usage fields, and error envelopes can differ.

SurfaceProduct coreAdapterIdentityWallet owner, product session, scoped keyOperator service credentialCatalogOwner entitlement and enabled routesProvider model and capability discoveryPricingPinned snapshot, conversion policy, maximum, actual chargeModel units, modifiers, usage and provider costInferenceOne operation, request binding, delivery stateInvoke / stream with bounded deadlinesResourcesOwner-scoped file, job, session and artifact grantsNative IDs and provider lifecycleRecoveryJournal, outbox, collection status, reconciliationProven lookup and idempotency behavior

## A modular adapter contract

```
type Provider interface {
    Discover(ctx Context, scope Scope) (Catalog, error)
    Quote(ctx Context, request NormalizedRequest) (PriceSpec, error)
    Invoke(ctx Context, request NormalizedRequest, out Stream) (Outcome, error)
    Lookup(ctx Context, ref ProviderReference) (Outcome, error)
    Health(ctx Context) (Observation, error)
}
// Conceptual interface. Capabilities and optional lookup support are explicit.
```

## Keep credentials behind the product boundary

The operator’s provider key remains in server-side secret storage. A Noemad product key belongs to a wallet owner and must never be forwarded as a provider credential. A shared provider account does not make its balance, logs, files, jobs, or conversation data visible to every product user.

Every resource request is authorized against the product owner before it reaches the adapter. Provider-native IDs are mapped to owner-scoped product IDs. File and artifact access must not rely on an unguessable URL alone.

## Bind the selected adapter to the quote

The quote records the provider ID, model ID, route, canonical body hash, rate snapshot, modifiers, conversion policy, enforced usage limits, maximum amount, chain, asset, merchant, allowed facilitator/proxy, and expiry. Accepted operations retain that snapshot when future rates change.

Keep the provider’s internal identity in trusted configuration. The public product is Noemad; no upstream provider is presented as its sole identity.

## Preserve protocol behavior

Chat Completions, Responses, and Messages keep their documented JSON and streaming shapes. The adapter observes terminal events and usage while forwarding output; the service does not buffer an entire stream just to wait for settlement. The payment receipt is read separately after usage is final.

Distinguish first-byte, idle, and total deadlines. An HTTP 200 or a few streamed tokens do not prove complete delivery. Unknown usage cannot be billed as the approved maximum.

## Fallback needs explicit permission and evidence

A new model, provider, or rate outside the approved snapshot needs a new quote. After output or a side effect is committed, or dispatch is ambiguous, do not silently repeat the operation. A request ID is useful for correlation but is not proof of provider idempotency.

Before supporting fallback, document which errors are definitively pre-dispatch, which operations can be looked up, and how costs and delivery guarantees are preserved.

## Qualification checklist

Validate discovery with the actual scoped credential.

Test each endpoint, input type, supported parameter, and output limit.

Check JSON/SSE event order, tool history, terminal errors, and complete output.

Verify usage attribution and pricing, including cache and modality units.

Exercise disconnect, timeout, duplicate nonce, restart, and reconciliation cases.

Publish data handling and the exact enabled capability set.

Prove a second adapter can satisfy the contract without changing wallet/payment core.

---

# Model catalog

Discovery, capabilities, official pricing sources, and model specifications.

Implementation target. This guide specifies the intended product surface. The current frontend uses local samples; it does not call an inference service or collect funds. An endpoint is enabled only after its adapter, ownership, usage, and payment behavior are qualified.

## Authenticated discovery is authoritative

GET /v1/models returns the models available to the product key or supported owner session. A public model name does not prove provider entitlement, quota, health, or an enabled Noemad route. Only qualified models may be presented as runnable.

```
GET /v1/models
GET /v1/models?type=embedding
GET /v1/models?type=rerank
GET /calculate/models
```

/calculate/models describes quoteable pricing specifications. A fresh quote validates request-specific options and creates an immutable cost snapshot. The browser must not maintain a competing pricing engine for real payments.

## Capability fields

FieldMeaningid / label / vendorStable public identifier, display name, and model developermodality / input_modalitiesEndpoint family and accepted input kindscontext_length / max_outputPublished limits; the admitted request may be bounded more tightlythinkingSupported reasoning values, including auto or none only when declarednative_dimensions / dimensionsEmbedding shape and any supported selectable dimensionsmax_documentsRerank candidate boundpricing unit / minimum / modifierHow this exact configuration is measuredenabled / health / entitlementSeparate live deployment facts; absent data is unknown

## Complete archived model reference

Model specification reference. Names and capability limits come from the imported catalog snapshot. Enabled models require fresh qualification. USD rates below are listed only when verified for the exact model against an official source; unverified prices are marked.

The library preserves 63 catalog records plus 9 additional entries from the exported capability pages: two later chat entries, two video entries, three speech entries, realtime, and typed evaluation. Browse and filter the entire collection in the model library.

FamilyReference recordsIntegration guideChat42Chat & textEmbeddings12EmbeddingsRerank5RerankImage6MediaVideo2Durable video jobsSpeech synthesis / transcription3AudioRealtime1RealtimeStructured evaluation1Typed decisions

## Chat capability records

Model referenceInputContext / outputReasoningGLM 5.3glm-5.3text1,000,000 / 128,000auto, low, medium, high, xhigh, maxGLM 5.3 Flashglm-5.3-flashtext, image, video1,000,000 / 128,000auto, low, medium, high, xhigh, maxGLM 5.2glm-5.2text1,000,000 / 128,000auto, low, medium, high, xhigh, maxGLM 5.1glm-5.1text200,000 / 128,000auto, low, medium, highGLM 5.0 Turboglm-5.0-turbotext200,000 / 128,000auto, low, medium, highGLM 5V Turboglm-5v-turbotext, image, video200,000 / 128,000auto, low, medium, highMuse Spark 1.1muse-spark-1.1text1,048,576 / 1,000,000auto, none, low, medium, high, xhigh, maxMuse Spark 1.2muse-spark-1.2text1,048,576 / 1,000,000auto, none, low, medium, high, xhigh, maxQwen 3.8 Maxqwen3.8-maxtext, image, video1,000,000 / 64,000auto, none, low, medium, highQwen 3.7 Maxqwen3.7-maxtext1,000,000 / 64,000auto, none, low, medium, highQwen 3.7 Plusqwen3.7-plustext, image1,000,000 / 64,000auto, none, low, medium, highKimi K3kimi-k3text, image, video1,000,000 / 64,000auto, low, high, maxKimi K2.7kimi-k2.7text, image256,000 / 32,000auto, low, medium, highKimi K2.6kimi-k2.6text, image256,000 / 32,000auto, low, medium, highKimi K2.5kimi-k2.5text, image256,000 / 32,000auto, low, medium, highDeepSeek V4 Prodeepseek-v4-protext, image1,000,000 / 384,000auto, low, medium, highDeepSeek V4 Pro 0813deepseek-v4-pro-0813text1,000,000 / 384,000auto, none, low, medium, high, maxDeepSeek V4 Flashdeepseek-v4-flashtext1,000,000 / 384,000auto, low, medium, highDeepSeek V4.1 Flashdeepseek-v4.1-flashtext, image1,000,000 / 128,000auto, none, low, medium, high, maxDeepSeek V4 Flash 0731deepseek-v4-flash-0731text1,000,000 / 384,000auto, none, low, medium, high, maxMiniMax M3minimax-m3text, image, video1,000,000 / 48,000auto, low, medium, highMiniMax M2.7minimax-m2.7text, image200,000 / 48,000auto, low, medium, highHunyuan 3hy3text1,000,000 / 64,000auto, low, medium, highHunyuan 4hy4text1,000,000 / 64,000auto, low, medium, highGrok 4.5grok-4.5text, image, file500,000 / 64,000auto, minimal, low, medium, high, xhighGrok 4.6grok-4.6text, image, file500,000 / 64,000auto, low, medium, high, xhighGPT 5.5gpt-5.5text, image, file1,050,000 / 128,000auto, none, low, medium, high, xhighGPT 6 Astragpt-6-astratext, image, video, file1,050,000 / 128,000auto, low, medium, high, xhigh, maxGPT 5.6 Solgpt-5.6-soltext, image, file1,050,000 / 128,000auto, none, low, medium, high, xhigh, maxGPT 5.6 Terragpt-5.6-terratext, image, file1,050,000 / 128,000auto, none, low, medium, high, xhigh, maxGPT 5.6 Lunagpt-5.6-lunatext, image, file1,050,000 / 128,000auto, none, low, medium, high, xhigh, maxClaude Fable 5.1claude-fable-5.1text, image, file1,000,000 / 128,000auto, low, medium, high, xhigh, maxClaude Fable 5claude-fable-5text, image, file1,000,000 / 128,000auto, low, medium, high, xhigh, maxClaude Opus 5claude-opus-5text, image, file1,000,000 / 128,000auto, low, medium, high, xhigh, maxClaude Opus 4.8claude-opus-4.8text, image, file1,000,000 / 128,000auto, low, medium, high, xhigh, maxClaude Opus 4.7claude-opus-4.7text, image, file1,000,000 / 128,000auto, low, medium, high, xhigh, maxClaude Opus 4.6claude-opus-4.6text, image, file1,000,000 / 128,000auto, none, low, medium, high, xhigh, maxClaude Sonnet 5claude-sonnet-5text, image, file1,000,000 / 128,000auto, low, medium, high, xhigh, maxClaude Sonnet 4.6claude-sonnet-4.6text, image, file1,000,000 / 128,000auto, none, low, medium, high, xhigh, maxClaude Haiku 4.5claude-haiku-4.5text, image, file200,000 / 64,000auto, low, medium, high, xhigh, maxGLM 5.3 FlashXglm-5.3-flashxtext, image, video1,000,000 / 128,000Not specifiedGrok 4.7grok-4.7text, image, file500,000 / 64,000Not specified

## Specialized records

Model referenceCapabilityNative dimension / boundGpt 5.5 Imagegpt-5.5-imageImagesAdapter-specificGpt 5.6 Luna Imagegpt-5.6-luna-imageImagesAdapter-specificGpt 5.6 Sol Imagegpt-5.6-sol-imageImagesAdapter-specificGpt 5.6 Terra Imagegpt-5.6-terra-imageImagesAdapter-specificGrok Imagine Imagegrok-imagine-imageImagesAdapter-specificGrok Imagine Image 2.0grok-imagine-image-2.0ImagesAdapter-specificBGE Small ENbge-small-enEmbeddings384 dimensionsBGE Base ENbge-base-enEmbeddings768 dimensionsBGE Large ENbge-large-enEmbeddings1024 dimensionsBGE-M3bge-m3Embeddings1024 dimensionsEmbeddingGemma 300Membeddinggemma-300mEmbeddings768 dimensionsQwen3 Embedding 0.6Bqwen3-embedding-0.6bEmbeddings1024 dimensionsBGE Reranker Basebge-reranker-baseRerank100 documentsvoyage-4-litevoyage-4-liteEmbeddings1024 dimensionsvoyage-4voyage-4Embeddings1024 dimensionsvoyage-4-largevoyage-4-largeEmbeddings1024 dimensionsvoyage-code-4voyage-code-4Embeddings1024 dimensionsvoyage-finance-2voyage-finance-2Embeddings1024 dimensionsvoyage-law-2voyage-law-2Embeddings1024 dimensionsVoyage rerank-3voyage-rerank-3Rerank100 documentsVoyage rerank-3-litevoyage-rerank-3-liteRerank100 documentsVoyage rerank-2.5voyage-rerank-2.5Rerank100 documentsVoyage rerank-2.5-litevoyage-rerank-2.5-liteRerank100 documentsGrok Imagine Videogrok-imagine-videoVideoAdapter-specificGrok Imagine Video 1.5grok-imagine-video-1.5VideoAdapter-specificGrok Voice TTSgrok-voice-ttsSpeech synthesisAdapter-specificGrok Voice Transcribe 1.0grok-voice-transcribe-1.0TranscriptionAdapter-specificGrok Voice Transcribe 2.0grok-voice-transcribe-2.0TranscriptionAdapter-specificGPT Livegpt-liveRealtimeAdapter-specificJev 1.13jev-1.13Structured evaluationAdapter-specific

## Changes are explicit

A model alias, provider mapping, supported tool, rate, or maximum changes the request contract. Publish new configuration for future quotes and preserve accepted snapshots. If a provider cannot honor a pinned rate, the operator absorbs the difference or rejects before dispatch; it must not increase the user’s approved charge.

---

# API compatibility

Endpoint directory, authentication, headers, streaming, and errors.

Implementation target. This guide specifies the intended product surface. The current frontend uses local samples; it does not call an inference service or collect funds. An endpoint is enabled only after its adapter, ownership, usage, and payment behavior are qualified.

Planned API origin. Examples use https://noemad.dev/v1, the intended product API path. The API is not connected in this frontend preview. MODEL_ID_FROM_DISCOVERY and NOEMAD_API_KEY are placeholders, not published credentials or model IDs. A product API key identifies an account; a separate payment-aware transport must handle spending authorization.

## Two related API surfaces

/v1 retains the inference request and response families. Wallet authentication and payment status are additional product endpoints. They do not replace Chat Completions, Responses, Messages, or specialized modality payloads with a single text-only wrapper.

MethodPathPurposePOST/v1/chat/completionsChat Completions JSON / SSE; messages and toolsPOST/v1/responsesResponses JSON / event streamPOST/v1/messagesMessages content blocks / event streamPOST/v1/messages/count_tokensCompatible token count; qualification requiredPOST/v1/images/generationsImage generationPOST/v1/images/editsImage editing with a validated sourcePOST/v1/videosCreate a durable video jobGET/v1/videos/{id}Read job state and resultPOST/v1/audio/speechSpeech synthesisPOST/v1/audio/transcriptionsAudio transcriptionPOST/v1/filesOwner-scoped uploadGET/v1/artifacts/download/{token}Expiring owner-scoped artifact deliveryPOST/v1/realtime/callsNegotiate one WebRTC voice sessionDELETE/v1/realtime/sessions/{id}Release a sessionPOST/v1/embeddingsCreate indexed text vectorsPOST/v1/rerankRank supplied candidate documentsPOST/v1/structured-evaluationTyped answers from state and questions; renamed product routeGET/v1/modelsCaller-scoped model discoveryGET/v1/usageThe product owner’s usage; no shared provider balanceGET/calculate/modelsQuoteable rate specificationsGET/calculateQuote a bounded request shapePOST/dashboard/wallet/challengeCreate a wallet sign-in challengePOST/dashboard/wallet/verifyVerify a signed challengeGET/api/v1/payments/{quote_id}Owner-only inference and collection state, actual cost, receipt

The structured-evaluation route is an explicit product naming change. The precise DTOs and headers remain implementation contracts to freeze with backend fixtures before enabling clients.

## Product identity and payment are separate

Inference uses a scoped Noemad product API key or a supported playground session. The key belongs to the wallet account. It can restrict models, expiry, rate, and concurrency; it is not a provider key and does not authorize a token debit.

```
Authorization: Bearer NOEMAD_API_KEY
Content-Type: application/json

# Messages-compatible authentication, if supported by the frozen contract:
x-api-key: NOEMAD_API_KEY
```

The intended wallet entry uses /dashboard/wallet/challenge and /dashboard/wallet/verify. Connection is followed by a server-verified challenge; the session must enforce origin, nonce, expiry, cookie security, and CSRF protection.

## Common and payment headers

HeaderUseAuthorization / x-api-keyProduct authentication, according to the endpoint contractContent-TypeMatch JSON, multipart, SDP, or binary endpoint requirementsIdempotency-KeyOne key for one immutable logical mutationX-Request-IDA bounded caller correlation value; not proof of deduplicationPAYMENT-REQUIREDx402 payment requirements returned with HTTP 402PAYMENT-SIGNATUREClient authorization using the pinned x402 v2 upto schemaX-Quote-IDProduct extension binding retry to the immutable quoteRetry-AfterDelay before another eligible status check or safe retryX-Noemad-Request-IDProposed product correlation header; final spelling requires fixture agreementX-Noemad-Realtime-Control-TokenProposed session-release token header; keep it out of logs and URLs

Generic SDKs do not automatically understand the quote extension. Use a payment-aware transport or local proxy owned by the user. Do not invent a payment signature format or silently sign on a user’s behalf.

## 402 → authorize maximum → deliver → settle actual

Authenticate and validate the exact model, body, route, rate, and admission limits.

Create a quote and return payment requirements before inference.

The client checks the quote and obtains a bounded wallet authorization.

Retry the same operation with the same quote, body, and authorization.

The server binds the nonce once, then streams or returns the inference result.

After reliable usage is final, calculate and collect the actual amount within the maximum.

Read GET /api/v1/payments/{quote_id} for collection state and the verified receipt.

The unused maximum remains in the wallet. Authorization does not transfer the maximum, reserve the wallet balance, or prove future collection will succeed.

## Inspect the full response lifecycle

An error before response headers can use an HTTP error status. After a response begins, an error may arrive within an HTTP 200 stream. A buffered response can also contain an error body after initial whitespace. Always inspect the terminal payload.

ProtocolTerminal failure referenceChat Completions SSEAn error object in a data frame; do not assume partial choices completedMessages SSEAn error event with the Messages error envelopeResponses SSEresponse.failed with response.error fieldsBuffered JSONA complete parsed result or an error envelopePayment collectionA separate owner-only status after inference; never inferred from stream success

Do not insert product payment events into an established SSE protocol without an explicit compatibility design. A final settlement header cannot be added to already-sent HTTP headers. Partial tool arguments must never be executed.

## Error directory

These codes retain the reference surface where applicable; the wallet/payment extension replaces prepaid-credit errors with explicit quote and collection states. Final mappings require endpoint fixtures. Check the machine-readable code and owner-scoped status instead of inferring a cause from a generic message.

HTTPCodeAction400invalid_client_request_idCorrect the caller request ID.400invalid_fileValidate file bytes, encoding, size, and accepted type.400invalid_imageValidate image bytes, dimensions, and encoding.400invalid_reasoning_effortUse a level advertised by the selected model.400invalid_request_errorCorrect missing fields, invalid JSON, or invalid parameter values.400invalid_tool_historyMatch each tool result to its original tool-call ID.400output_token_limit_exceededLower the output cap before a new quote.400request_blocked_by_policyReview the request; repeated retries do not change a policy decision.400streaming_requiredUse a supported streaming transport with the same product payment rules.400unsupported_model_for_endpointChoose a model qualified for this endpoint.400unsupported_request_parameterRemove or correct the unsupported control.400unsupported_toolsUse a supported tool declaration or model.401invalid_api_keyCheck the product key; never substitute a provider credential.402payment_requiredReview the quote and authorization; a bearer key does not authorize spending.403key_expired / key_revokedRenew or replace the product key through the owner session.403permission_deniedCheck account role, model scope, and ownership.403entitlement_limitRespect the active per-request offer or account limit.404model_not_foundRefresh authenticated model discovery.413request_too_largeReduce the conversation or attachment size.422unsupported_input_modalityChoose a compatible model and payload.429client_error_cooldownWait and correct repeated invalid requests.429concurrency_limitWait for an active operation to finish.429image_requests_temporarily_limitedHonor the delay before another image operation.429ip_rate_limitReduce request frequency from the network.429model_rate_limitedWait before another request to that model.429rate_limitHonor Retry-After and the account or key limit.500internal_errorUse bounded backoff; preserve the quote and operation reference.500token_count_failedRecord the request ID and retry only when safe.502empty_model_responseNo usable output was returned; inspect the operation outcome.502invalid_model_responseDo not treat an unparsable response as success.502invalid_model_tool_argumentsNever execute incomplete or invalid tool arguments.502invalid_model_tool_callNever execute an undeclared tool.502request_processing_failedInspect owner-scoped operation state before another dispatch.502stream_interruptedPartial text or tool arguments remain incomplete.502tool_generation_limit_exceededDo not execute the incomplete action.503model_temporarily_unavailableUse bounded backoff; the code alone does not identify a cause.503service_busyHonor Retry-After and avoid duplicate operations.504generation_timeoutReconcile a possibly dispatched operation before creating another.504stream_idle_timeoutInspect the terminal outcome and any completed tool actions.504stream_time_limit_exceededTreat partial output according to the published delivery policy.504token_count_timeoutUse bounded backoff and retain correlation metadata.

## Retry and support information

Correct input, identity, permission, scope, and policy failures before retrying. For transient failures, use bounded exponential backoff with jitter and honor a numeric Retry-After. Preserve quote, operation, and idempotency identity; do not create a second paid operation because the first timed out.

Save the product request ID, endpoint, model, approximate time, and operation reference. Exclude credentials, raw payment signatures, and private session-control tokens from support messages and public logs.

## Ownership and asynchronous resources

Files, jobs, sessions, results, and artifact grants belong to the authenticated product owner. Video uses a durable submit/poll lifecycle. Realtime uses one session across turns and requires explicit release. An expiring artifact URL is a delivery mechanism rather than permanent hosting.

---

# Chat & text

Compatible chat formats, model capabilities, reasoning, tools, and output.

Implementation target. This guide specifies the intended product surface. The current frontend uses local samples; it does not call an inference service or collect funds. An endpoint is enabled only after its adapter, ownership, usage, and payment behavior are qualified.

Planned API origin. Examples use https://noemad.dev/v1, the intended product API path. The API is not connected in this frontend preview. MODEL_ID_FROM_DISCOVERY and NOEMAD_API_KEY are placeholders, not published credentials or model IDs. A product API key identifies an account; a separate payment-aware transport must handle spending authorization.

## Choose the right request format

EndpointPayload styleTypical use/v1/chat/completionsmessages, tools, streamChat history and broad compatible SDK support/v1/responsesinput, reasoning, toolsResponses clients and structured agent workflows/v1/messagessystem, messages, max_tokensMessages-compatible clients and content blocks

All three retain their native success and error contracts. Payment authorization wraps the transport lifecycle; it does not require changing the model’s prompt into a proprietary single-input format.

## Chat Completions example

```
{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "messages": [
    {
      "role": "system",
      "content": "Return a concise, useful answer."
    },
    {
      "role": "user",
      "content": "Summarize the design and list next steps."
    }
  ],
  "max_tokens": 1024,
  "thinking": "medium",
  "stream": true
}
```

Send only controls advertised by the chosen model. The example reasoning level is a placeholder choice, not a universal supported value. The service must quote and enforce the actual output limit before dispatch.

## Responses example

```
{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Explain this design in three points."
        }
      ]
    }
  ],
  "max_output_tokens": 1024,
  "reasoning": {
    "effort": "medium"
  },
  "stream": true
}
```

Preserve response event ordering, content item IDs, final usage, and failure events. A client should not treat the first output delta as a completed response.

## Messages example

```
{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "system": "Be concise and state uncertainty.",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Review this proposal."
        }
      ]
    }
  ],
  "max_tokens": 1024,
  "stream": true
}
```

Messages content blocks and stop semantics must remain compatible. The server may accept the Messages authentication header where the final contract declares it. A separate token-count operation must be qualified before clients depend on it.

## Read capabilities instead of guessing

Use input_modalities, context_length, max_output, and thinking from authenticated discovery. Text, image, video, and file input support vary even within one model family. Model-specific attachment limits and MIME requirements must also be enforced.

The complete archived capability table and searchable model library preserve the source records. Their published maximums do not override Noemad’s admitted request limits.

## Reasoning controls

auto delegates the choice only when supported. none disables reasoning only on models that advertise it. Levels such as minimal, low, medium, high, xhigh, and max are model-specific. A model with only auto should not show a runtime effort selector.

The adapter maps product-compatible fields such as reasoning.effort or a thinking value into the native provider contract. Hidden reasoning tokens may affect usage differently from visible output; the quote must state the relevant limit and billing behavior.

## Tool definitions and complete history

```
{
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "lookup_note",
        "description": "Read a note the user has allowed this app to access.",
        "parameters": {
          "type": "object",
          "properties": {
            "note_id": {
              "type": "string"
            }
          },
          "required": [
            "note_id"
          ],
          "additionalProperties": false
        }
      }
    }
  ],
  "tool_choice": "auto"
}
```

Tool declarations must match the endpoint format and selected model. A returned call must name a declared tool and contain complete schema-valid arguments. Match every tool result to its original call ID; preserve the original order and content blocks when continuing the conversation.

The application, not the model, authorizes tool execution. Model output cannot increase a spending budget, change a payment recipient, or expand a tool’s data access. Parallel tool calls are permitted only when both model and application support them.

## Structured output and validation

Where supported, schema-constrained text output can request a specific object shape. It is distinct from the dedicated typed evaluation endpoint. Pin the schema and model configuration, then validate the entire output.

```
{
  "title": "An illustrative summary",
  "summary": "A brief explanation of the proposal.",
  "actions": [
    "Resolve the main open decision.",
    "Assign the next task."
  ]
}
```

Reject empty content, unrecognized error envelopes, truncated JSON, invalid tool arguments, and forbidden finish reasons. A response succeeds only after its complete protocol and output contract are satisfied.

## Usage and payment outcome

Record ordinary input, cached input, output, reasoning, or cache-write fields according to the model’s documented accounting. Do not double-count cached input already included in total input. Missing usage is unknown, not zero or the approved maximum.

Inference completion and collection are separate. A usable partial stream can be billable under the pinned delivery policy, but it must have reliable attributable usage. An uncertain dispatch or usage outcome enters reconciliation rather than triggering a duplicate inference request.

---

# Media

Image, video, speech, transcription, files, and artifact delivery.

Implementation target. This guide specifies the intended product surface. The current frontend uses local samples; it does not call an inference service or collect funds. An endpoint is enabled only after its adapter, ownership, usage, and payment behavior are qualified.

Planned API origin. Examples use https://noemad.dev/v1, the intended product API path. The API is not connected in this frontend preview. MODEL_ID_FROM_DISCOVERY and NOEMAD_API_KEY are placeholders, not published credentials or model IDs. A product API key identifies an account; a separate payment-aware transport must handle spending authorization.

## Endpoint families

CapabilityEndpointLifecycleImage generationPOST /v1/images/generationsSynchronous JSON or provider-supported streamImage editingPOST /v1/images/editsValidated source images and edit controlsVideoPOST /v1/videos · GET /v1/videos/{id}Durable job and pollingSpeechPOST /v1/audio/speechPlayable audio bytes or a verified artifactTranscriptionPOST /v1/audio/transcriptionsAudio upload to a complete transcriptFilesPOST /v1/filesOwner-scoped upload referenceArtifactsGET /v1/artifacts/download/{token}Scoped, expiring delivery grant

Media controls are model-specific. An input file is not authorized merely because the UI can select it. The server validates content, size, ownership, supported types, and cost modifiers before admission.

## Image generation

```
{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "prompt": "A marble observatory above an ancient Greek coastline.",
  "size": "1024x1024",
  "quality": "medium",
  "n": 1,
  "response_format": "b64_json"
}
```

Only offer sizes, quality settings, counts, and response formats supported by the adapter. An image response may contain encoded bytes or an expiring URL. Check its actual MIME type and dimensions; the filename alone is not evidence.

The archive distinguishes GPT image variants and two Imagine image versions. Some have separate quality, resolution, aspect-ratio, and editing controls. Those archived names do not imply that the corresponding route is enabled in Noemad.

## Image edits and uploads

```
POST /v1/images/edits
Content-Type: multipart/form-data; boundary=BOUNDARY
Idempotency-Key: SAME_LOGICAL_EDIT_KEY

model = MODEL_ID_FROM_DISCOVERY
prompt = Extend the courtyard, keeping the central statue.
image = <validated local image bytes>
# Add size, mask, quality, or extra images only when supported.
```

Do not base64-wrap a file when the chosen endpoint requires multipart. Validate each source independently, apply count and resolution limits, and quote any extra-input surcharge. A retry keeps the same idempotency key and body.

An upload returns an owner-scoped file ID only after acceptance. Map it to the provider reference on the server. Do not expose a shared provider file catalog or let one wallet retrieve another wallet’s files.

## Durable video jobs

```
{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "prompt": "A slow camera orbit around a marble astronomical instrument.",
  "duration": 6,
  "resolution": "720p"
}
```

```
queued → running → succeeded
               ↘ failed
               ↘ unknown → reconcile
Owner reads GET /v1/videos/{id} for the same durable job.
```

Persist the accepted job ID before polling. The create response may indicate that the job is still preparing or queued. Honor server polling guidance and stop when a terminal state is confirmed.

A client reconnect or worker restart resumes the same job. An unknown create outcome is not permission to create another paid video. Publish cancellation and expiration semantics only once the adapter can prove them.

A completed response must include verified duration, size, format, and a scoped result grant. Missing or invalid artifacts are not successful delivery merely because the provider job says completed.

## Speech synthesis and transcription

```
{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "input": "Welcome to Noemad. Let us turn an idea into a result.",
  "voice": "VOICE_FROM_DISCOVERY",
  "response_format": "mp3"
}
```

Speech synthesis validates text length, voice, language, speed or style controls, and output encoding. Stream or return audio only with the correct content type. A playable artifact and its delivered duration are part of the completion check.

```
POST /v1/audio/transcriptions
Content-Type: multipart/form-data; boundary=BOUNDARY

model = MODEL_ID_FROM_DISCOVERY
file = <audio bytes>
language = en
response_format = json
```

Transcription validates duration, encoding, file size, and any supported language hint. The result may include text, segments, or timestamps only when the selected format declares them. Invalid or incomplete transcripts must remain errors.

## Artifact ownership and expiry

A download grant is scoped to one owner and artifact. It can expire independently of the operation record. Display its expiry and provide a documented way to obtain a new grant if supported. Do not construct an undocumented download URL from a job ID.

Before serving bytes, validate size, content type, and allowed disposition. Apply an explicit retention and deletion policy before production; this frontend does not promise permanent media hosting.

## Quote the modality’s real unit

ModalityRelevant measurementPotential modifiersImagesDelivered image countSize, quality, resolution, number of edit sourcesVideoAccepted or delivered duration under the profile policyResolution, model version, input mediaSpeech synthesisCharacters under the pinned counting ruleVoice, model, minimum chargeTranscriptionAudio durationModel, duration rounding, minimum chargeRealtimeEstablished session or qualified metering unitSession cap, language, voice, turn limits

The client authorizes a maximum derived from enforceable limits. The service settles attributable actual usage afterward. Failed or uncertain delivery follows the declared profile policy; missing usage never permits an automatic maximum debit. See Billing & limits.

## Preview behavior

The media workspace exposes local sample controls and state transitions. It does not upload selected files, contact a model, generate media, or create a payment. The site’s decorative backgrounds and animated illustrations are original frontend assets, separate from inference outputs.

---

# Realtime

WebRTC conversations, language and voice controls, delegation, and cleanup.

Implementation target. This guide specifies the intended product surface. The current frontend uses local samples; it does not call an inference service or collect funds. An endpoint is enabled only after its adapter, ownership, usage, and payment behavior are qualified.

Planned API origin. Examples use https://noemad.dev/v1, the intended product API path. The API is not connected in this frontend preview. MODEL_ID_FROM_DISCOVERY and NOEMAD_API_KEY are placeholders, not published credentials or model IDs. A product API key identifies an account; a separate payment-aware transport must handle spending authorization.

## One session, several turns

A realtime voice connection carries microphone input, synthesized audio, transcripts, and session events over WebRTC. Establish the session once and keep it open for multiple turns; do not submit a new paid call for every utterance.

The UI needs distinct idle, requesting-permission, connecting, active, muted, interrupted, closing, and closed states. Only request microphone access after the user starts a voice action. Always expose a visible stop control.

## Session configuration

```
{
  "type": "realtime",
  "model": "MODEL_ID_FROM_DISCOVERY",
  "language": "en-US",
  "instructions": "Speak naturally, keep answers concise, and state uncertainty.",
  "audio": {
    "output": {
      "voice": "VOICE_FROM_DISCOVERY"
    }
  },
  "delegation": {
    "type": "client",
    "ack_filler": false
  }
}
```

FieldTarget behaviormodelA realtime model from qualified discoverylanguageauto or a bounded canonical BCP-47 language taginstructionsOptional role, tone, and response guidanceaudio.output.voiceOne advertised voice, chosen before connectingdelegation.ack_fillerExplicit control of acknowledgement filler when supported

Archived language presets include en-US, en-GB, id-ID, ms-MY, ar-SA, cs-CZ, da-DK, nl-NL, fil-PH, zh-CN, ja-JP, ko-KR, es-ES, fr-FR, de-DE, it-IT, mk-MK, fa-IR, pl-PL, pt-BR, ro-RO, ru-RU, sv-SE, th-TH, tr-TR, vi-VN, and hi-IN. Validate the selected tag against the actual adapter.

The source voice list includes alloy, arbor, ash, ballad, breeze, cedar, coral, cove, echo, ember, juniper, maple, marin, sage, shimmer, sol, spruce, vale, and verse. This is an archived list, not live voice availability.

## Negotiate through an authorized application route

```
// Browser-side design sketch. The product session/payment layer is required.
const peer = new RTCPeerConnection();
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
for (const track of stream.getTracks()) peer.addTrack(track, stream);
peer.ontrack = event => { remoteAudio.srcObject = event.streams[0]; };
const events = peer.createDataChannel('session-events');
const offer = await peer.createOffer();
await peer.setLocalDescription(offer);

// Proposed payment-aware application transport, not a published SDK method.
const established = await authorizedCall('/v1/realtime/calls', {
  sdp: peer.localDescription.sdp,
  session
});
await peer.setRemoteDescription({ type: 'answer', sdp: established.sdp });
// Persist the product session reference for explicit cleanup.
```

The server verifies product identity and the bounded payment authorization before establishing a costed session. Provider keys remain on the server. If direct browser media access needs a token, issue only a short-lived scoped credential.

The response can include an SDP answer, a private session ID, and a single-session control token. Keep control tokens out of logs, URLs, screenshots, and model prompts. Exact response fields must be frozen with the adapter fixtures.

## Conversation loop

Request microphone permission after a deliberate start action.

Review the session’s price unit, spending maximum, duration, and expiry.

Negotiate the same authorized session once.

Play remote audio and display transcript/state events from the data channel.

Keep the connection for subsequent turns and show mute/interrupt state clearly.

After terminal failure or expiry, close and reconcile the session before creating another.

## Connect a chat model to a live conversation

The application owns conversation history. For a task that must use a selected chat model, its backend sends recent turns to /v1/chat/completions under its own authorized product operation. After validating the answer, the client can append it as speakable context to the open realtime channel.

```
// Proposed adapter event format; not a universal vendor SDK format.
events.send(JSON.stringify({
  type: 'session.context.append',
  channel: 'speakable',
  content: [{ type: 'input_text', text: verifiedChatAnswer }]
}));
```

The archived bridge can emit delegation.created and accept delegation.context.append. A model deciding when to delegate does not guarantee a particular chat request will run. Call the chat operation explicitly when the application requires it, and apply a separate approved spending policy.

These events need adapter-specific compatibility testing. Do not assume they match the event format of every realtime SDK. No complete bridge download is linked until a maintained package exists in this project.

## Release the server session

```
DELETE /v1/realtime/sessions/SESSION_ID
Authorization: Bearer NOEMAD_API_KEY
X-Noemad-Realtime-Control-Token: SESSION_CONTROL_TOKEN
```

Stop every local microphone track, close the data channel and peer connection, and request server release. A page closing or a local microphone stopping is not proof that the remote session ended.

Release should be idempotent for the same owner and session. Persist enough state to recover cleanup after a dropped connection. Publish maximum duration, idle timeout, release-token policy, and any cancellation charge before enabling voice.

## Metering and collection

A realtime quote defines the actual billing unit and enforceable session limits. The archived reference used a rate per successfully established session; a different provider might meter duration or tokens and requires a new specification. Failed negotiation must be classified separately from an established session.

Final usage and collection status remain independent of audio playback. If a session or usage outcome is uncertain, reconcile it. The frontend preview never activates the microphone or negotiates a live call.

---

# Embeddings

Text vectors, supported dimensions, batching, and retrieval.

Implementation target. This guide specifies the intended product surface. The current frontend uses local samples; it does not call an inference service or collect funds. An endpoint is enabled only after its adapter, ownership, usage, and payment behavior are qualified.

Planned API origin. Examples use https://noemad.dev/v1, the intended product API path. The API is not connected in this frontend preview. MODEL_ID_FROM_DISCOVERY and NOEMAD_API_KEY are placeholders, not published credentials or model IDs. A product API key identifies an account; a separate payment-aware transport must handle spending authorization.

## An endpoint for indexed vectors

POST /v1/embeddings accepts one string or a bounded batch and returns one vector per input in stable order. Discover compatible models with GET /v1/models?type=embedding; a chat model is not automatically an embedding model.

The reference target accepts up to 64 strings per request. Per-item, aggregate size, and token limits must also be enforced by the qualified adapter.

## Archived embedding models

Model specification reference. Names and capability limits come from the imported catalog snapshot. Enabled models require fresh qualification. USD rates below are listed only when verified for the exact model against an official source; unverified prices are marked.

Reference modelNative dimensionsLanguagesBGE Small ENbge-small-en384enBGE Base ENbge-base-en768enBGE Large ENbge-large-en1024enBGE-M3bge-m31024multilingualEmbeddingGemma 300Membeddinggemma-300m768multilingualQwen3 Embedding 0.6Bqwen3-embedding-0.6b1024multilingualvoyage-4-litevoyage-4-lite1024multilingualvoyage-4voyage-41024multilingualvoyage-4-largevoyage-4-large1024multilingualvoyage-code-4voyage-code-41024multilingualvoyage-finance-2voyage-finance-21024multilingualvoyage-law-2voyage-law-21024multilingual

## Request

```
{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "input": [
    "A document about semantic search.",
    "A note about finding related ideas."
  ],
  "encoding_format": "float",
  "input_type": "document",
  "dimensions": 1024
}
```

FieldRulesmodelRequired, from typed discoveryinputOne string or 1–64 stringsencoding_formatfloat arrays or base64 when supporteddimensionsOnly a selectable dimension advertised by that modelinput_typequery or document for models that accept this distinctionuserOptional bounded application user reference; never a secret

The archived Voyage 4 series supports 256, 512, 1024, or 2048 dimensions. Finance and law records use 1024. Other archived models retain their native dimension. These values need fresh adapter qualification before becoming live product choices.

## Response validation

```
{
  "object": "list",
  "model": "MODEL_ID_FROM_DISCOVERY",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.012,
        -0.034,
        0.021
      ]
    },
    {
      "object": "embedding",
      "index": 1,
      "embedding": [
        0.028,
        0.017,
        -0.009
      ]
    }
  ],
  "usage": {
    "item_count": 2,
    "dimensions": 3,
    "encoding_format": "float"
  }
}
```

The vectors above are shortened illustrative values, not real embeddings. Validate one output index for every input, the exact selected dimension, finite numeric values, and the declared encoding. A missing item is an incomplete result.

## Batching and retrieval

Chunk and normalize documents consistently.

Embed bounded batches with the document mode when supported.

Store the model, version, dimension, and normalization method alongside each vector.

Embed the query using a compatible query mode and dimension.

Retrieve candidates, then optionally rerank them.

Do not mix vectors from different models or dimensions in the same comparison space. Reindex when the representation changes. Retrying a batch preserves operation identity and indexes; it must not double-charge already delivered work.

## Token and byte units are distinct

Embedding billing must follow the selected hosted provider’s official USD unit. Tokenization and any UTF-8 counting rules are adapter-specific; a local byte count is not an exact token count for another model.

Use the quote’s pinned unit and any verified minimum, then settle reliable attributable usage. The billing reference shows verified USD rates and clearly marks prices that could not be established. The final USDC payment terms come from a fresh quote.

---

# Rerank

Relevance ordering for a bounded set of candidate documents.

Implementation target. This guide specifies the intended product surface. The current frontend uses local samples; it does not call an inference service or collect funds. An endpoint is enabled only after its adapter, ownership, usage, and payment behavior are qualified.

Planned API origin. Examples use https://noemad.dev/v1, the intended product API path. The API is not connected in this frontend preview. MODEL_ID_FROM_DISCOVERY and NOEMAD_API_KEY are placeholders, not published credentials or model IDs. A product API key identifies an account; a separate payment-aware transport must handle spending authorization.

## A second pass after retrieval

POST /v1/rerank scores supplied documents against a query and returns original document indexes in descending relevance. Use it after keyword or vector retrieval to select useful context for a model.

Discover models with GET /v1/models?type=rerank. A model-specific score is not a calibrated universal probability; evaluate thresholds on representative data.

## Archived rerank records

Model specification reference. Names and capability limits come from the imported catalog snapshot. Enabled models require fresh qualification. USD rates below are listed only when verified for the exact model against an official source; unverified prices are marked.

Model referenceCandidate boundLanguagesBGE Reranker Basebge-reranker-base100 documentsmultilingualVoyage rerank-3voyage-rerank-3100 documentsmultilingualVoyage rerank-3-litevoyage-rerank-3-lite100 documentsmultilingualVoyage rerank-2.5voyage-rerank-2.5100 documentsmultilingualVoyage rerank-2.5-litevoyage-rerank-2.5-lite100 documentsmultilingual

## Request limits

FieldReference contractmodelAn explicit qualified rerank model; do not rely on a hidden defaultqueryRequired, non-empty, up to 2,048 charactersdocuments1–100 strings; up to 8,192 characters per documenttop_n1 through the supplied document count; omitted means all candidates

```
{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "query": "How can I improve a product brief?",
  "documents": [
    "Begin with the user problem and the intended outcome.",
    "A recipe for sourdough bread.",
    "List the constraints, owner, and next decision."
  ],
  "top_n": 2
}
```

## Response

```
{
  "object": "list",
  "model": "MODEL_ID_FROM_DISCOVERY",
  "results": [
    {
      "index": 0,
      "relevance_score": 0.94
    },
    {
      "index": 2,
      "relevance_score": 0.87
    }
  ]
}
```

Indexes refer to the original input order. Verify uniqueness, bounds, finite scores, and the requested result count. Keep the original candidates in the application rather than trusting a returned index without validation.

## Language and quality

Ranking often works best when query and documents use compatible languages. Test Indonesian, Malay, English, and mixed-language cases with realistic candidates before qualifying a model. Record model and profile version when comparing evaluation results.

## All submitted candidates count

The archived rerank billing basis includes the query and every submitted document with a model-specific minimum. top_n limits returned results; it does not reduce the input processed or quoted. The exact tokenizer and unit belong to the selected adapter’s price snapshot.

Authorize the bounded request maximum and collect the measured actual amount. A failure or unknown outcome must be classified and reconciled before another chargeable attempt.

---

# Structured evaluation

Typed answers and probabilities from a state and named questions.

Implementation target. This guide specifies the intended product surface. The current frontend uses local samples; it does not call an inference service or collect funds. An endpoint is enabled only after its adapter, ownership, usage, and payment behavior are qualified.

Planned API origin. Examples use https://noemad.dev/v1, the intended product API path. The API is not connected in this frontend preview. MODEL_ID_FROM_DISCOVERY and NOEMAD_API_KEY are placeholders, not published credentials or model IDs. A product API key identifies an account; a separate payment-aware transport must handle spending authorization.

## A separate inference contract

The proposed POST /v1/structured-evaluation accepts a state and named questions. It is a dedicated capability, distinct from chat, embeddings, rerank, and schema-constrained text output. The public route name is an explicit Noemad adaptation.

The state may be text or a structured JSON object. Send 1–64 questions, using stable IDs that the response preserves under answers. The archived reference model is Jev 1.13; it is a catalog record rather than an active route.

## Question types

TypeCriteriaAnswer shapenoulOptional descriptions of true and falseA numeric noul value from 0 to 1choice2–64 named optionsSelected option, confidence, and option probabilitiesscore2–64 ordered labelsNumeric score, confidence, legend, and label probabilities

Keep the exact typed contract instead of translating it into ordinary chat messages. Probability-like values are model outputs and require calibration before they drive consequential decisions.

## Request example

```
{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "state": "A customer says the payment failed three times and asks for help.",
  "questions": {
    "urgent": {
      "type": "noul",
      "instructions": "Does this require prompt attention?"
    },
    "team": {
      "type": "choice",
      "instructions": "Which team should handle it?",
      "criteria": {
        "billing": "Payment questions",
        "technical": "Product defects"
      }
    },
    "frustration": {
      "type": "score",
      "instructions": "Estimate the stated frustration.",
      "criteria": [
        "Calm",
        "Frustrated",
        "Angry"
      ]
    }
  }
}
```

## Response example

```
{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "answers": {
    "urgent": {
      "type": "noul",
      "noul": 0.96
    },
    "team": {
      "type": "choice",
      "choice": "billing",
      "confidence": 0.9,
      "probabilities": {
        "billing": 0.94,
        "technical": 0.06
      }
    },
    "frustration": {
      "type": "score",
      "score": 1.2,
      "confidence": 0.7,
      "legend": {
        "0": "Calm",
        "1": "Frustrated",
        "2": "Angry"
      },
      "probabilities": {
        "0": 0,
        "1": 0.8,
        "2": 0.2
      }
    }
  },
  "usage": {
    "input_tokens": 100,
    "output_tokens": 30
  }
}
```

This is an illustrative response. Validate every expected question ID, declared type, numeric range, option key, score legend, and output-size bound. Missing answers are errors, not implicit false values.

## Validation and recovery

Reject undeclared fields where the profile requires a strict schema. Preserve usage and outcome even if a temporary offer results in no charge. A timeout or malformed response is not a successful evaluation and should not be replaced silently with a new paid attempt.

If evaluation results trigger workflow actions, the application must enforce its own authorization and review policy. Model confidence cannot expand a signer’s budget, modify access controls, or approve a financial transfer.

## Zero-charge must be truthful

A historical free offer is not a current Noemad price or an indefinite guarantee. A verified rate and a live quote determine actual terms. If the calculated amount is zero, close the operation as zero_charge; do not invent an onchain transaction for display.

---

# Billing & limits

Official USD rates, bounded USDC authorization, and measured actual cost.

Implementation target. This guide specifies the intended product surface. The current frontend uses local samples; it does not call an inference service or collect funds. An endpoint is enabled only after its adapter, ownership, usage, and payment behavior are qualified.

## Pay for the inference you use

Noemad charges a request according to the selected model’s rate and attributable usage. The user keeps tokens in their own wallet; the app does not create a prepaid balance.

Model prices are shown in USD using official sources where the exact model and billing unit can be verified. The final payment quote is denominated in USDC on Monad. An unverified model price is shown as Price not verified, never a guessed rate or a free offer.

The operator’s provider account and the user’s activity remain separate. /v1/usage must return owner-scoped usage, not the balance or logs of a shared service account.

## What a quote freezes

TermMeaningOwner, method, path, body hashThe exact logical request this authorization can serveProvider and model IDsThe qualified configuration selected for this operationUSD rate snapshot and versionInput, output, cache, modality units, modifiers, and any verified offerUSDC conversion and rounding policyHow measured USD cost becomes token atomic unitsEnforced usage limitsThe real bounds used to calculate the maximumMaximum amountThe most this one authorization permitsChain, asset, merchantNetwork, token contract, and exact recipientFacilitator and proxyThe allowed collection pathExpiryThe bounded authorization window

Use integer or fixed-point accounting. Preserve both the pre-rounding amount and the final token atomic amount. A rate change applies to future quotes; an operator must absorb an unplanned difference or reject before dispatch.

A public price table helps comparison. It is not a request-specific quote, a guaranteed availability signal, or permission to spend from a wallet.

## Authorize a maximum; settle actual usage

The target x402 v2 upto mechanism authorizes a maximum and collects the actual amount after reliable usage is known. It uses the pinned Permit2/proxy mechanism from the chosen SDK. The maximum is not transferred to the merchant before inference.

Validate the request and obtain an immutable quote.

Review origin, model, limits, rates, maximum, network, asset, recipient, expiry, facilitator, and proxy.

Complete any required wallet allowance, then sign the bounded authorization.

Bind the nonce once to the owner, operation, and request hash before dispatch.

Deliver inference and durably record attributable usage.

Calculate the final amount and persist one settlement job.

Verify the bound onchain receipt before marking collection settled.

The unused maximum stays in the wallet. Authorization does not reserve funds, so a balance or allowance can change before collection. An inference can succeed while collection fails; those states must remain separate.

## Compute the USD cost from the right units

```
ordinary_input = total_input - included_cache_read
USD_cost = ordinary_input × USD_input_rate
         + cache_read × USD_cache_rate
         + output × USD_output_rate
         + other documented model-specific units
```

Token rates are often quoted per one million tokens; divide the measured count by the stated unit before applying the rate. Only subtract cached input when the provider’s total-input definition already includes it. Reasoning and cache-write units follow the exact model contract.

Prefer a verified, request-correlated provider receipt where available. Otherwise calculate from validated usage and the pinned rate snapshot. A change in a shared provider account balance cannot attribute one request’s cost during concurrent use.

## USD to USDC: an illustrative calculation

The following figures are a worked example, not a model price. It assumes that this example quote explicitly converts USD to USDC at 1:1 and uses a token with six decimals. Production quotes must disclose their actual conversion and rounding policy.

Illustrative itemCalculationInput / cached input / output1,201 / 800 / 203 tokensOrdinary input at $1.25 per 1M401 × $1.25 / 1,000,000 = $0.00050125Cache read at $0.125 per 1M800 × $0.125 / 1,000,000 = $0.00010000Output at $5.00 per 1M203 × $5.00 / 1,000,000 = $0.00101500Measured USD cost$0.00161625Quoted conversion, rounded down1,616 atomic units = 0.001616 USDC

The operator absorbs the sub-atomic remainder under the planned rounding policy. It is not saved as hidden debt or a future top-up. The project plan adds no model markup; any network fee is disclosed separately along with who pays it.

## Chat pricing in USD

These are official USD rates only where the exact model is verified. Input, output, cached input, cache creation, and reasoning can have different definitions. Do not substitute a nearby model’s price for an unverified identifier.

ModelUSD rateOfficial sourceGLM 5.3Input: $1.40 / 1M tokensOutput: $4.40 / 1M tokensCached input: $0.26 / 1M tokensOfficial source ↗Checked 2026-10-24International API list rates. Cache storage and tool charges are separate.GLM 5.3 FlashInput: $0.15 / 1M tokensOutput: $0.50 / 1M tokensCached input: $0.03 / 1M tokensOfficial source ↗Checked 2026-10-24International API list rates. Cache storage and tool charges are separate.GLM 5.2Input: $1.40 / 1M tokensOutput: $4.40 / 1M tokensCached input: $0.26 / 1M tokensOfficial source ↗Checked 2026-10-24International API list rates. Cache storage and tool charges are separate.GLM 5.1Input: $1.40 / 1M tokensOutput: $4.40 / 1M tokensCached input: $0.26 / 1M tokensOfficial source ↗Checked 2026-10-24International API list rates. Cache storage and tool charges are separate.GLM 5.0 TurboPrice not verifiedOfficial source ↗Checked 2026-10-24This exact ID has no verified official USD price row; no price is inferred from GLM-5 or GLM-5-Turbo.GLM 5V TurboPrice not verifiedOfficial source ↗Checked 2026-10-24The model has official capability documentation, but its current USD tariff was not present in the official price table checked.Muse Spark 1.1Input: $1.25 / 1M tokensOutput: $4.25 / 1M tokensCached input: $0.15 / 1M tokensOfficial source ↗Checked 2026-10-24Standard mode; no long-context premium. Search grounding is billed separately.Muse Spark 1.2Input: $1.25 / 1M tokensOutput: $4.25 / 1M tokensCached input: $0.15 / 1M tokensOfficial source ↗Checked 2026-10-24Standard mode; no long-context premium. Search grounding is billed separately.Qwen 3.8 MaxInput: $2.00 / 1M tokensOutput: $6.00 / 1M tokensOfficial source ↗Checked 2026-10-24Singapore international deployment, up to 1M input tokens. Standard list rates; cache, batch, and regional discounts excluded.Qwen 3.7 MaxInput: $2.50 / 1M tokensOutput: $7.50 / 1M tokensOfficial source ↗Checked 2026-10-24Singapore international deployment, up to 1M input tokens. Standard list rates; cache, batch, and regional discounts excluded.Qwen 3.7 PlusInput: $0.40 / 1M tokensOutput: $1.60 / 1M tokensInput above 256K context: $1.20 / 1M tokensOutput above 256K context: $4.80 / 1M tokensOfficial source ↗Checked 2026-10-24Singapore international list rates before promotions. Up to 256K input tokens: base rates; above 256K: higher tier. Cache discount excluded.Kimi K3Input: $3.00 / 1M tokensOutput: $15.00 / 1M tokensCached input: $0.30 / 1M tokensCache write · 5 minutes: $3.00 / 1M tokensCache write · 1 hour: $6.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard token rates. Cache writes are billed separately by TTL; the token calculator excludes writes, tools, and taxes.Kimi K2.7Price not verifiedOfficial source ↗Checked 2026-10-24Official pricing names kimi-k2.7-code. This exact catalog ID is not confirmed as an alias; no tariff is inferred.Kimi K2.6Input: $0.95 / 1M tokensOutput: $4.00 / 1M tokensCached input: $0.16 / 1M tokensOfficial source ↗Checked 2026-10-24Standard token rates. K2 access restrictions begin October 31; retirement is planned by December 2026. Taxes excluded.Kimi K2.5Price not verifiedOfficial source ↗Checked 2026-10-24This exact older version is absent from the current official pricing table. No current USD rate verified.DeepSeek V4 ProInput: $1.32 / 1M tokensOutput: $3.96 / 1M tokensCached input: $0.044 / 1M tokensOfficial source ↗Checked 2026-10-24Peak rates. Off-peak is 50% lower. See official UTC schedule and Chinese public-holiday exceptions.DeepSeek V4 Pro 0813Input: $1.32 / 1M tokensOutput: $3.96 / 1M tokensCached input: $0.044 / 1M tokensOfficial source ↗Checked 2026-10-24Official table identifies this version under API ID deepseek-v4-pro. Peak rates shown; off-peak is 50% lower.DeepSeek V4 FlashInput: $0.30 / 1M tokensOutput: $1.20 / 1M tokensCached input: $0.006 / 1M tokensOfficial source ↗Checked 2026-10-24Accepted legacy alias now serves V4.1-Flash-1017. Peak rates shown; off-peak is 50% lower.DeepSeek V4.1 FlashPrice not verifiedOfficial source ↗Checked 2026-10-24Current API uses deepseek-flash for V4.1-Flash-1017. This exact version/ID mapping has no separately verified current tariff.DeepSeek V4 Flash 0731Price not verifiedOfficial source ↗Checked 2026-10-24This retired version has no current first-party USD tariff verified. The legacy unversioned alias serves a newer model.MiniMax M3Input: $0.60 / 1M tokensOutput: $2.40 / 1M tokensCached input: $0.12 / 1M tokensInput above 512K context · list: $1.20 / 1M tokensOutput above 512K context · list: $4.80 / 1M tokensCached input above 512K context · list: $0.24 / 1M tokensOfficial source ↗Checked 2026-10-24Standard list rates before the displayed permanent 50% discount. Above 512K input tokens, rates double. Priority costs 1.5× standard.MiniMax M2.7Price not verifiedOfficial source ↗Checked 2026-10-24Older price references exist, but this exact model is absent from the current official pricing overview. Current USD tariff unverified.Hunyuan 3Input: $0.132 / 1M tokensOutput: $0.528 / 1M tokensCached input: $0.033 / 1M tokensOfficial source ↗Checked 2026-10-24Tencent TokenHub Singapore list rates. Model identifier hy3 is confirmed by the official model list.Hunyuan 4Price not verifiedOfficial source ↗Checked 2026-10-24Official model list and pricing use hy4-preview. This exact hy4 ID is not confirmed as an alias; no price is inferred.Grok 4.5Input: $2.00 / 1M tokensOutput: $6.00 / 1M tokensCached input: $0.30 / 1M tokensOfficial source ↗Checked 2026-10-24Global standard rates; all token rates double at 200k input tokens. Regional endpoints and tools can add charges.Grok 4.6Input: $2.00 / 1M tokensOutput: $6.00 / 1M tokensCached input: $0.50 / 1M tokensOfficial source ↗Checked 2026-10-24Global standard rates; all token rates double at 200k input tokens. Regional endpoints and tools can add charges.GPT 5.5Input (up to 272K context): $5.00 / 1M tokensOutput (up to 272K context): $30.00 / 1M tokensCached input (up to 272K context): $0.50 / 1M tokensInput (over 272K context): $10.00 / 1M tokensOutput (over 272K context): $45.00 / 1M tokensCached input (over 272K context): $1.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard API, global processing, input up to 272K tokens. Meter uses short-context input/output/cache-read rates; longer prompts use the separately listed rates. Tool charges and cache writes are additional.GPT 6 AstraInput (up to 272K context): $10.00 / 1M tokensOutput (up to 272K context): $50.00 / 1M tokensCached input (up to 272K context): $1.00 / 1M tokensInput (over 272K context): $20.00 / 1M tokensOutput (over 272K context): $75.00 / 1M tokensCached input (over 272K context): $2.00 / 1M tokens30-minute cache write (up to 272K context): $12.50 / 1M tokens12-hour cache write (up to 272K context): $25.00 / 1M tokens30-minute cache write (over 272K context): $25.00 / 1M tokens12-hour cache write (over 272K context): $50.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard API, global processing, input up to 272K tokens. Meter uses short-context input/output/cache-read rates; longer prompts use the separately listed rates. Tool charges and cache writes are additional.GPT 5.6 SolInput (up to 272K context): $4.00 / 1M tokensOutput (up to 272K context): $20.00 / 1M tokensCached input (up to 272K context): $0.40 / 1M tokensInput (over 272K context): $8.00 / 1M tokensOutput (over 272K context): $30.00 / 1M tokensCached input (over 272K context): $0.80 / 1M tokens30-minute cache write (up to 272K context): $5.00 / 1M tokens12-hour cache write (up to 272K context): $10.00 / 1M tokens30-minute cache write (over 272K context): $10.00 / 1M tokens12-hour cache write (over 272K context): $20.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard API, global processing, input up to 272K tokens. Meter uses short-context input/output/cache-read rates; longer prompts use the separately listed rates. Tool charges and cache writes are additional. Promotional rate is available at least through November 21, 2026.GPT 5.6 TerraInput (up to 272K context): $2.00 / 1M tokensOutput (up to 272K context): $12.00 / 1M tokensCached input (up to 272K context): $0.20 / 1M tokensInput (over 272K context): $4.00 / 1M tokensOutput (over 272K context): $18.00 / 1M tokensCached input (over 272K context): $0.40 / 1M tokens30-minute cache write (up to 272K context): $2.50 / 1M tokens12-hour cache write (up to 272K context): $5.00 / 1M tokens30-minute cache write (over 272K context): $5.00 / 1M tokens12-hour cache write (over 272K context): $10.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard API, global processing, input up to 272K tokens. Meter uses short-context input/output/cache-read rates; longer prompts use the separately listed rates. Tool charges and cache writes are additional.GPT 5.6 LunaInput (up to 272K context): $0.20 / 1M tokensOutput (up to 272K context): $1.20 / 1M tokensCached input (up to 272K context): $0.02 / 1M tokensInput (over 272K context): $0.40 / 1M tokensOutput (over 272K context): $1.80 / 1M tokensCached input (over 272K context): $0.04 / 1M tokens30-minute cache write (up to 272K context): $0.25 / 1M tokens12-hour cache write (up to 272K context): $0.50 / 1M tokens30-minute cache write (over 272K context): $0.50 / 1M tokens12-hour cache write (over 272K context): $1.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard API, global processing, input up to 272K tokens. Meter uses short-context input/output/cache-read rates; longer prompts use the separately listed rates. Tool charges and cache writes are additional.Claude Fable 5.1Input: $10.00 / 1M tokensOutput: $50.00 / 1M tokensCache read: $0.25 / 1M tokens5-minute cache write: $12.50 / 1M tokens1-hour cache write: $20.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard first-party Claude API, global routing. Meter excludes separate cache-write and server-tool charges; batch, fast-mode and regional rates differ.Claude Fable 5Input: $10.00 / 1M tokensOutput: $50.00 / 1M tokensCache read: $1.00 / 1M tokens5-minute cache write: $12.50 / 1M tokens1-hour cache write: $20.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard first-party Claude API, global routing. Meter excludes separate cache-write and server-tool charges; batch, fast-mode and regional rates differ.Claude Opus 5Input: $5.00 / 1M tokensOutput: $25.00 / 1M tokensCache read: $0.50 / 1M tokens5-minute cache write: $6.25 / 1M tokens1-hour cache write: $10.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard first-party Claude API, global routing. Meter excludes separate cache-write and server-tool charges; batch, fast-mode and regional rates differ.Claude Opus 4.8Input: $5.00 / 1M tokensOutput: $25.00 / 1M tokensCache read: $0.50 / 1M tokens5-minute cache write: $6.25 / 1M tokens1-hour cache write: $10.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard first-party Claude API, global routing. Meter excludes separate cache-write and server-tool charges; batch, fast-mode and regional rates differ.Claude Opus 4.7Input: $5.00 / 1M tokensOutput: $25.00 / 1M tokensCache read: $0.50 / 1M tokens5-minute cache write: $6.25 / 1M tokens1-hour cache write: $10.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard first-party Claude API, global routing. Meter excludes separate cache-write and server-tool charges; batch, fast-mode and regional rates differ.Claude Opus 4.6Input: $5.00 / 1M tokensOutput: $25.00 / 1M tokensCache read: $0.50 / 1M tokens5-minute cache write: $6.25 / 1M tokens1-hour cache write: $10.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard first-party Claude API, global routing. Meter excludes separate cache-write and server-tool charges; batch, fast-mode and regional rates differ.Claude Sonnet 5Input: $2.00 / 1M tokensOutput: $10.00 / 1M tokensCache read: $0.20 / 1M tokens5-minute cache write: $2.50 / 1M tokens1-hour cache write: $4.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard first-party Claude API, global routing. Meter excludes separate cache-write and server-tool charges; batch, fast-mode and regional rates differ.Claude Sonnet 4.6Input: $3.00 / 1M tokensOutput: $15.00 / 1M tokensCache read: $0.30 / 1M tokens5-minute cache write: $3.75 / 1M tokens1-hour cache write: $6.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard first-party Claude API, global routing. Meter excludes separate cache-write and server-tool charges; batch, fast-mode and regional rates differ.Claude Haiku 4.5Input: $1.00 / 1M tokensOutput: $5.00 / 1M tokensCache read: $0.10 / 1M tokens5-minute cache write: $1.25 / 1M tokens1-hour cache write: $2.00 / 1M tokensOfficial source ↗Checked 2026-10-24Standard first-party Claude API, global routing. Meter excludes separate cache-write and server-tool charges; batch, fast-mode and regional rates differ.GLM 5.3 FlashXInput: $0.37 / 1M tokensOutput: $1.25 / 1M tokensCached input: $0.075 / 1M tokensOfficial source ↗Checked 2026-10-24International API list rates. Cache storage and tool charges are separate.Grok 4.7Input: $2.00 / 1M tokensOutput: $6.00 / 1M tokensCached input: $0.50 / 1M tokensOfficial source ↗Checked 2026-10-24Global standard rates; all token rates double at 200k input tokens. Regional endpoints and tools can add charges.

## Embedding and rerank pricing in USD

Use the hosted provider’s official billing unit. An open-weight model alone does not define a hosted API price. Batches include all submitted inputs; rerank includes the query and every candidate, regardless of top_n.

ModelUSD rateOfficial sourceBGE Small ENPrice not verifiedOfficial source ↗Checked 2026-10-24Open model weights. Hosting costs depend on the operator; no universal developer API list price.BGE Base ENPrice not verifiedOfficial source ↗Checked 2026-10-24Open model weights. Hosting costs depend on the operator; no universal developer API list price.BGE Large ENPrice not verifiedOfficial source ↗Checked 2026-10-24Open model weights. Hosting costs depend on the operator; no universal developer API list price.BGE-M3Price not verifiedOfficial source ↗Checked 2026-10-24Open model weights. Hosting costs depend on the operator; no universal developer API list price.EmbeddingGemma 300MPrice not verifiedOfficial source ↗Checked 2026-10-24Google documents this 300M open embedding model for deployment on your own hardware. No fixed first-party per-token API price is published here; hosting costs depend on deployment.Qwen3 Embedding 0.6BPrice not verifiedOfficial source ↗Checked 2026-10-24Open weights for self-hosting. No official hosted API USD tariff verified for this exact model; infrastructure cost varies.BGE Reranker BasePrice not verifiedOfficial source ↗Checked 2026-10-24Open model weights. Hosting costs depend on the operator; no universal developer API list price.voyage-4-liteInput: $0.02 / 1M tokensOfficial source ↗Checked 2026-10-24Standard text embedding API input-token rate after any account-specific free allowance; batch pricing differs.voyage-4Input: $0.06 / 1M tokensOfficial source ↗Checked 2026-10-24Standard text embedding API input-token rate after any account-specific free allowance; batch pricing differs.voyage-4-largeInput: $0.12 / 1M tokensOfficial source ↗Checked 2026-10-24Standard text embedding API input-token rate after any account-specific free allowance; batch pricing differs.voyage-code-4Input: $0.12 / 1M tokensOfficial source ↗Checked 2026-10-24Standard text embedding API input-token rate after any account-specific free allowance; batch pricing differs.voyage-finance-2Input: $0.12 / 1M tokensOfficial source ↗Checked 2026-10-24Standard text embedding API input-token rate after any account-specific free allowance; batch pricing differs.voyage-law-2Input: $0.12 / 1M tokensOfficial source ↗Checked 2026-10-24Standard text embedding API input-token rate after any account-specific free allowance; batch pricing differs.Voyage rerank-3Processed input: $0.05 / 1M tokensOfficial source ↗Checked 2026-10-24Official standard API rate for rerank-3; catalog uses a vendor-prefixed label. Billed tokens equal query tokens times document count, plus all document tokens. Account allowances and batch discounts are excluded.Voyage rerank-3-liteProcessed input: $0.02 / 1M tokensOfficial source ↗Checked 2026-10-24Official standard API rate for rerank-3-lite; catalog uses a vendor-prefixed label. Billed tokens equal query tokens times document count, plus all document tokens. Account allowances and batch discounts are excluded.Voyage rerank-2.5Processed input: $0.05 / 1M tokensOfficial source ↗Checked 2026-10-24Official standard API rate for rerank-2.5; catalog uses a vendor-prefixed label. Billed tokens equal query tokens times document count, plus all document tokens. Account allowances and batch discounts are excluded.Voyage rerank-2.5-liteProcessed input: $0.02 / 1M tokensOfficial source ↗Checked 2026-10-24Official standard API rate for rerank-2.5-lite; catalog uses a vendor-prefixed label. Billed tokens equal query tokens times document count, plus all document tokens. Account allowances and batch discounts are excluded.

## Media, realtime, and evaluation pricing in USD

Image count, video duration, speech characters, transcription duration, realtime sessions, and evaluation requests need separate units. A verified base rate does not establish a price for every size, quality, voice, or duration.

ModelUSD rateOfficial sourceGpt 5.5 ImagePrice not verifiedOfficial source ↗Checked 2026-10-24No official API rate or documented official alias was found for this exact catalog ID. Published GPT Image prices have not been substituted.Gpt 5.6 Luna ImagePrice not verifiedOfficial source ↗Checked 2026-10-24No official API rate or documented official alias was found for this exact catalog ID. Published GPT Image prices have not been substituted.Gpt 5.6 Sol ImagePrice not verifiedOfficial source ↗Checked 2026-10-24No official API rate or documented official alias was found for this exact catalog ID. Published GPT Image prices have not been substituted.Gpt 5.6 Terra ImagePrice not verifiedOfficial source ↗Checked 2026-10-24No official API rate or documented official alias was found for this exact catalog ID. Published GPT Image prices have not been substituted.Grok Imagine ImageImage input: $0.002 / imageOutput · 1K / 2K: $0.02 / imageOfficial source ↗Checked 2026-10-24Text prompts have no separate charge.Grok Imagine Image 2.0Image input: $0.01 / image1K · Low: $0.04 / image1.5K · Low: $0.05 / image2K · Low: $0.06 / image1K · Medium: $0.06 / image1.5K · Medium: $0.07 / image2K · Medium: $0.08 / imageOfficial source ↗Checked 2026-10-24Select the resolution and quality when estimating.Grok Imagine VideoImage input: $0.002 / imageVideo input: $0.01 / secondOutput · 480p: $0.05 / secondOutput · 720p: $0.07 / secondOfficial source ↗Checked 2026-10-24Charges depend on input media and generated duration.Grok Imagine Video 1.5Image input: $0.01 / imageOutput · 480p: $0.08 / secondOutput · 720p: $0.14 / secondOutput · 1080p: $0.25 / secondOfficial source ↗Checked 2026-10-24Charges depend on input media and generated duration.Grok Voice TTSSpeech synthesis: $15.00 / 1M charactersOfficial source ↗Checked 2026-10-24Catalog label for the xAI TTS service; the native endpoint selects voice_id rather than this model ID.Grok Voice Transcribe 1.0Price not verifiedOfficial source ↗Checked 2026-10-24The current guide lists 2.0; pricing for version 1.0 was not confirmed.Grok Voice Transcribe 2.0REST transcription: $0.10 / hourStreaming transcription: $0.20 / hourOfficial source ↗Checked 2026-10-24Current transcription model confirmed in the official speech-to-text guide.GPT LivePrice not verifiedOfficial source ↗Checked 2026-10-24Official pricing identifies gpt-live-1; the catalog ID gpt-live has no confirmed official alias mapping. Duration-based pricing must not be substituted without that mapping.Jev 1.13Input: $0.042 / 1M tokensOutput: $0.00 / 1M tokensOfficial source ↗Checked 2026-10-24Official version jev-1.13.0. Input only; output has no charge.

## Price the selected output settings

SettingWhat the quote must establishImage quality and resolutionThe selected model’s official output price or documented multiplierPortrait or landscape dimensionsWhether size changes the billing unit or rateImage edit sourcesAny documented per-input or image-token costVideo duration and resolutionThe supported seconds, size, and corresponding rateSpeech voice and formatAny priced model, voice, output, or minimum-charge differencesTranscription lengthThe actual measured duration and published rounding ruleRealtime sessionA verified session, duration, or token unit with enforceable caps

Do not apply a generic multiplier across model families. Each modifier and any minimum must be confirmed against that exact model’s official pricing and frozen into the quote. Missing pricing means the paid route cannot be offered yet.

## Inference and collection remain separate

```
Operation: quoted → authorized → dispatched → streaming / completed / failed / unknown
Collection: none → authorized → ready → settling → settled / zero_charge / unknown / failed
```

A successful stream does not prove collection settled. Read GET /api/v1/payments/{quote_id} for actual cost and a verified receipt. A collection retry must not rerun inference.

Pin the actual amount before settlement retry and preserve the same authorization and nonce. Verify chain, asset, allowed proxy, payer, merchant, amount, nonce, success, and the required block state. A transfer event alone is insufficient.

## Unknown usage is never charged as the maximum

Missing final usage, an ambiguous dispatch, a consumed nonce without a bound transaction, or uncertain settlement enters reconciliation. Do not automatically debit the maximum, request a fresh signature, or rerun the model.

A known zero amount closes as zero_charge without a fabricated transaction. An allowance revoke or insufficient balance can cause collection_failed; the operator must bound outstanding liability and show the real state.

## Calculator and production quotes

The calculator estimates USD cost from verified official rates where available. It does not create a live USDC quote, authorize payment, or imply that the selected model is connected.

The server produces live quote terms from the qualified model and enforceable limits. Rewards and campaigns can map to explicit per-request discounts or compensation under published policy, without creating a prepaid product balance.

---

# SDK & CLI

Client configuration, payment-aware transports, tools, and recovery.

Implementation target. This guide specifies the intended product surface. The current frontend uses local samples; it does not call an inference service or collect funds. An endpoint is enabled only after its adapter, ownership, usage, and payment behavior are qualified.

Planned API origin. Examples use https://noemad.dev/v1, the intended product API path. The API is not connected in this frontend preview. MODEL_ID_FROM_DISCOVERY and NOEMAD_API_KEY are placeholders, not published credentials or model IDs. A product API key identifies an account; a separate payment-aware transport must handle spending authorization.

## Compatible inference needs a payment-aware transport

The standard SDK body and stream formats remain useful, but a plain bearer-key client cannot authorize a wallet debit. A costed request can return HTTP 402 with a quote. A user-owned transport or local proxy must review requirements, obtain the permitted signature, preserve X-Quote-ID, and retry the same operation.

No maintained Noemad SDK, CLI installer, or bridge package has been published in this preview. The following examples define the integration surface; they are not claims that any generic client is already fully compatible.

## Python SDK shape

```
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://noemad.dev/v1",
    api_key=os.environ["NOEMAD_API_KEY"],
)

# A bare SDK call needs a payment-aware transport before live use.
response = client.chat.completions.create(
    model="MODEL_ID_FROM_DISCOVERY",
    messages=[{"role": "user", "content": "Summarize the brief."}],
    max_tokens=1024,
)
print(response.choices[0].message.content)
```

```
stream = client.chat.completions.create(
    model="MODEL_ID_FROM_DISCOVERY",
    messages=[{"role": "user", "content": "Explain the next step."}],
    max_tokens=1024,
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")
# Handle terminal errors and retrieve the separate payment receipt.
```

Use SDK hooks or an explicit transport wrapper to handle the payment handshake; do not keep resubmitting the request on 402. The service still validates the complete response and final usage. The consumer must treat an interrupted stream as incomplete.

## Inspect a request with curl

```
curl https://noemad.dev/v1/chat/completions \
  -H "Authorization: Bearer $NOEMAD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"MODEL_ID_FROM_DISCOVERY","messages":[{"role":"user","content":"Hello."}],"max_tokens":100}'

# This does not sign or pay. A costed endpoint can return HTTP 402.
# Inspect the requirements in a payment-aware client.
```

## Messages-compatible CLI configuration

```
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://noemad.dev",
    "ANTHROPIC_AUTH_TOKEN": "NOEMAD_PRODUCT_KEY_PLACEHOLDER",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "MODEL_ID_FROM_DISCOVERY",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "MODEL_ID_FROM_DISCOVERY",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "MODEL_ID_FROM_DISCOVERY"
  },
  "model": "opus"
}
```

This is the archived configuration pattern for a Messages-compatible CLI. Map each slot to an actually qualified model. Keep the key in protected local configuration or the client’s supported secret mechanism. Restart existing sessions or warm workers after changing configuration.

A desktop bridge is a separate integration requiring a maintained, signed implementation and a local permission model. No desktop installer is linked from this preview.

## Responses-compatible CLI configuration

```
model = "MODEL_ID_FROM_DISCOVERY"
model_provider = "noemad"
model_reasoning_effort = "medium"

[model_providers.noemad]
name = "Noemad"
base_url = "https://noemad.dev/v1"
wire_api = "responses"

# Authentication and payment transport must be configured using the
# installed CLI version's supported mechanism. No signer is uploaded.
```

The archived client integration used command-backed authentication and a discovered model catalog. A maintained Noemad integration must pin the client version, test the response lifecycle, protect local key files, and provide a payment-aware transport without embedding private keys in configuration.

Reasoning choices must come from the selected model. Do not expose a fixed universal list or assume a command-line flag is accepted by every client version.

## OpenAI-compatible provider configuration

```
{
  "provider": {
    "noemad": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Noemad",
      "options": {
        "baseURL": "https://noemad.dev/v1",
        "apiKey": "NOEMAD_PRODUCT_KEY_PLACEHOLDER"
      },
      "models": {
        "MODEL_ID_FROM_DISCOVERY": {
          "name": "Qualified model"
        }
      }
    }
  },
  "model": "noemad/MODEL_ID_FROM_DISCOVERY"
}
```

This illustrates the OpenCode-style provider/model mapping preserved by the source frontend. The provider key is a client configuration name; the model ID must come from product discovery. A payment-aware local transport can be the configured base URL once implemented.

## Tool integration directory

Client / toolPreserved configuration surfaceNoemad integration requirementClaude CodeMessages base URL, auth token, model slotsPayment-aware transport and compatible content/tool blocksClaude Desktop bridgeLocal bridge setup and model selectionMaintained signed bridge; explicit local permissionsCodex CLIResponses provider, model catalog, reasoningPinned client schema, streaming, bounded local signingOpenCodeCustom compatible provider and modelsPreserve unrelated config and provider/model mappingGrok BuildCustom endpoint, key, default modelQualify the installed client’s transport and tool lifecycleOpenClawCompatible provider and selected modelDiscover capabilities and verify a safe sample requestPiLocal model registry, API adapter, thinking levelsPreserve model capabilities and local agent policyHermesConfig and environment provider settingsUse supported config commands and secret storageAiderOpenAI-compatible API base and model selectorPayment transport, safe retries, and tool verificationContinueEditor model provider, API base, model IDKeep credentials outside source controlCursorCustom model base URL and API key settingsConfirm client support for payment extensioncurl / custom HTTPBearer auth, content type, JSON / multipartExplicit quote handling; no automatic signing

Future setup tools must create timestamped backups and preserve unrelated settings. Never advertise a one-command installer until the script is maintained, reviewable, and tested. Do not pipe a placeholder URL into a shell.

## Additional manual configuration patterns

```
# A compatible CLI may read these variables.
export OPENAI_API_BASE="https://noemad.dev/v1"
export OPENAI_API_KEY="$NOEMAD_API_KEY"
# Select MODEL_ID_FROM_DISCOVERY in the installed client's model setting.
```

```
{
  "models": [
    {
      "title": "Noemad",
      "provider": "openai",
      "model": "MODEL_ID_FROM_DISCOVERY",
      "apiBase": "https://noemad.dev/v1",
      "apiKey": "NOEMAD_PRODUCT_KEY_PLACEHOLDER"
    }
  ]
}
```

The JSON illustrates the archived editor configuration shape. Current client versions can use different schemas. Verify against the chosen version before writing a user’s configuration. Secrets are placeholders and must not be committed to a repository.

## Planned Go invocation flow

```
policy := LoadUserSpendingPolicy()
request := BuildCompatibleRequest()
challenge := RequestOrReadQuote(request)
policy.Check(challenge) // origin, model, limits, chain, asset, recipient, max

authorization := LoadOrSignSameBoundedAuthorization(challenge)
PersistQuoteAndAuthorizationJournal(challenge, authorization)
output := InvokeSameOperation(request, challenge.ID, authorization)
receipt := PollOwnerPaymentStatus(challenge.ID)
return output, receipt
```

The signer stays local or in the user’s chosen wallet. Pin cumulative budget, maximum per request, deadline, concurrency, allowed model scopes, facilitator, and proxy. A language model may propose a request but cannot raise its own spending cap or change the recipient.

## Crash recovery and receipts

Persist quote ID, request binding, authorization identity, and operation state before submission. Resume the same state after a crash. A lost response does not justify a new nonce, a new paid operation, or duplicate tool execution.

Keep inference state separate from collection state. After a stream ends, poll GET /api/v1/payments/{quote_id} for actual cost and the verified receipt. Pending and unknown operations still count toward the local outstanding-spend policy until reconciled.

---

# Reseller & procurement

Preserved order lifecycle reference for future operator integrations.

Internal integration inventory · disabled. The exported frontend included reseller and procurement workflows. Noemad does not expose a live reseller API or customer top-up balance in this preview. Retaining this reference does not enable an internal route.

The public product uses wallet identity and per-inference USDC payments on Monad. An operator may separately purchase capacity from a configured provider; that procurement credential, order, invoice, and ledger must remain outside the customer account surface.

## Separate operator procurement from customer payment

ConcernOwner / boundaryInference API keyWallet-owned product key; not a procurement credentialProcurement credentialOperator secret with a specific provider and roleProvider creditsOperator capacity; never returned as a shared customer balanceUser chargeMetered actual cost from an immutable inference quoteReceiptOne owner-scoped product operation; provider invoice remains private

The source’s account, order, provider-choice, and recovery concepts are preserved below. Quantities, prices, bonus rules, payment rails, expiry, and fulfillment units must come from the actual configured procurement contract. They must not be copied into Noemad retail offers.

## Proposed internal order directory

MethodReference pathPurposeGET/private/v1/reseller/meRead credential scope and procurement product termsGET/private/v1/reseller/payment-providers?quantity=1Read eligible payment routes for the intended purchasePOST/private/v1/reseller/ordersCreate one intended operator purchaseGET/private/v1/reseller/orders + Idempotency-KeyRecover the original order after a lost create responseGET/private/v1/reseller/orders/{id}Read preparation, payment, and fulfillment state

These paths describe an internal compatibility inventory only. A future operator service must explicitly approve its scope and authentication before any route is enabled. The frontend never calls them.

## Read terms before creating an order

```
{
  "account": {
    "id": "OPERATOR_ACCOUNT_REFERENCE"
  },
  "product": {
    "id": "PROCUREMENT_PRODUCT",
    "unit_quantity": "FROM_PROVIDER_CONTRACT",
    "price": "FROM_PROVIDER_CONTRACT",
    "expiry_policy": "FROM_PROVIDER_CONTRACT"
  },
  "payment_methods": [
    "CONFIGURED_METHODS"
  ]
}
```

Read the product contract to confirm unit size, price, supported methods, bonus eligibility, and capacity expiry. Do not infer them from an old marketing page. Store the procurement credential in a server secret manager; do not expose it in a browser field or product API response.

## Discover and preserve a provider choice

```
{
  "payment_method": "CONFIGURED_METHOD",
  "default_provider": 0,
  "selection_enabled": true,
  "quantity": 1,
  "providers": [
    {
      "id": 0,
      "name": "Automatic",
      "available": true,
      "reason": "eligible"
    },
    {
      "id": 1,
      "name": "Provider 1",
      "available": true,
      "reason": "eligible"
    },
    {
      "id": 2,
      "name": "Provider 2",
      "available": false,
      "reason": "temporarily_unavailable"
    }
  ]
}
```

A stable numeric choice can hide an underlying operator payment route. Zero or omission means the configured automatic policy. A manual route requires both selection_enabled and available to be true. Discovery does not create an invoice, reserve capacity, or guarantee a payment application will accept it.

A manual choice stays fixed through preparation, retries, recovery, and settlement. Never silently fall back to another route. If an older adapter cannot honor manual choice, return an explicit unsupported state and require a deliberate new choice before creation.

## One key for one intended purchase

```
Idempotency-Key: OPERATOR_PURCHASE_STABLE_ID
Content-Type: application/json

{"quantity":1,"payment_method":"CONFIGURED_METHOD","payment_provider":0}
```

Persist the purchase key before create. Scope it to the owner and canonical order request. Retrying the same key and body returns the same order; changing quantity, payment method, or route with that key returns an idempotency conflict.

The archived quantity bound was 1–100, but a new procurement adapter must publish its actual bound. Never assume that a repeated HTTP request is free of side effects when its first outcome is unknown.

## Preparing, recovery, and completion

```
preparing → pending → fulfilled
             │
             └── expired / cancelled
unknown → recover the same purchase key and order reference
```

Create may return HTTP 200 with a payment instruction, or HTTP 202 with payment: null while preparation continues. Save any order ID before polling. A 202 is not a failure and does not authorize a replacement invoice.

If the create response is lost, recover by the original idempotency key. Save any reference included in a 502 or 503, honor Retry-After, and query the same order. The archived workflow uses at least five seconds between preparation polls and a 5–10 second pending interval; an adapter’s actual guidance takes precedence.

## Render exact returned payment instructions

A configured procurement method can return token-network instructions or a local payment invoice. Display the exact returned amount, fee, total, merchant, method, and expiry. Do not generate an amount locally from a stale catalog or substitute a different token or network.

For a QR-based invoice, render a validated returned image or encode the returned payload. A ready QR is a pending instruction, not proof of payment. Parse expiry as the contract declares: a timestamp may be epoch seconds, a numeric string, or a timezone-qualified ISO value.

For token payments, verify the returned chain, contract, address, decimals, exact amount, and expiry. These operator procurement methods do not change Noemad’s customer-facing Monad payment contract.

## Poll the original order to fulfillment

Continue reading the same owner-scoped order until it is definitively fulfilled, expired, or cancelled. A payment debit or receipt screenshot requires investigation against that original reference. Do not create a replacement invoice just to try another route.

Payment confirmation and provider-capacity fulfillment may be separate steps. Apply fulfillment once and write an auditable ledger reference. Retrieve receipt documents through the documented authenticated history; never construct an undocumented PDF URL from an order ID.

## Error handling

HTTPReasonAction400invalid_quantityCorrect the amount within the published bound400invalid_payment_methodUse a configured payment method400invalid_idempotency_keySupply one valid stable purchase key401invalid_credentialCheck rotation, revocation, scope, and expiry404order_not_foundCheck ownership and the saved original reference409idempotency_conflictDo not mutate an existing purchase key503selected_provider_unavailablePreserve the selected route and any order reference503provider_selection_unavailableDo not assume an unsupported manual choice was honored502 / 503preparation_unavailableHonor Retry-After and recover the same purchaseunknownpayment_outcome_unknownReconcile the original reference before any new purchase

A temporary setup failure is not evidence that the credential is invalid or that no remote invoice exists. Bounded retries, stable identity, and reconciliation are required to avoid duplicate purchases.

## Postman and terminal tooling

A maintained integration collection would include account discovery, route discovery, create, recover, and status requests with placeholder credentials. A terminal client should persist state, hide secret input, and separate read-only check from explicit create.

```
procurement providers --quantity 1
procurement create --key STABLE_PURCHASE_ID --quantity 1 --state order.json
procurement check --state order.json
procurement resume --state order.json
```

No collection, installer, or executable download is advertised until it exists in this project and is tested. The source archive’s missing downloads are not represented as working links.