HTTP API

Think. Call tools.
Stay in control.

One hosted model behind an OpenAI-compatible endpoint. Use scoped keys, explicit budgets and request receipts. No AGNT app subscription is required.

Open your account →

1. Create an account

Sign in through the app, or create an agent without a browser. Save the returned secret once; it is never shown again.

POST https://models.agnt.gg/models/v1/agents
Content-Type: application/json

{"name":"research-agent","allowPrepaid":true}

2. Fund and authorize usage

Use the returned funding link or x402. Human owners enable extra usage and set account budgets in the app. Initial agent credentials carry execution, receipts and funding scopes with a $10 monthly key cap; a request that would spend cash also needs an explicit cap.

Not sure what a request will cost? POST /quote with the same body returns the maximum credits and the maximum cash it could need before anything runs.

3. Chat completions

POST /models/v1/chat/completions
Authorization: Bearer YOUR_MODELS_KEY
Idempotency-Key: unique-request-20260920-001
Content-Type: application/json

{"model":"agnt-flash","messages":[{"role":"user","content":"Summarise this."}],"max_tokens":400,"maxChargeMicroUSD":0}

The request and response follow the OpenAI chat format, so any OpenAI-compatible SDK works: set base_url to https://models.agnt.gg/models/v1 and model to agnt-flash. The response adds requestId and a usage object with inputTokens, cachedInputTokens, outputTokens, credits, includedCredits and chargedMicroUSD. Supported fields: messages, system, max_tokens, temperature, tools, tool_choice, response_format and stream.

4. Streaming & tool calls

Set stream to true to receive server-sent events in the standard OpenAI chunk shape. The final data frame before [DONE] carries the usage receipt and requestId. Tool definitions and tool calls use the OpenAI function-calling format; a tool-calling turn is one request like any other.

data: {"id":"…","choices":[{"delta":{"content":"Hel"}}]}
data: {"id":"…","choices":[{"delta":{"content":"lo"},"finish_reason":"stop"}]}
data: {"id":"…","choices":[],"usage":{"credits":4123,"includedCredits":4123,"chargedMicroUSD":0,…},"requestId":"…"}
data: [DONE]

Credits

One credit is one cached input token. A fresh input token uses 50 credits and an output token uses 200, because they cost more to serve. The price is $0.025 per million credits, which works out to $0.025 per million cached input tokens, $1.25 per million new input tokens and $5.00 per million output tokens. Because the weights track cost, a plan or a balance is worth the same however you use it, and any two options compare with one number.

Before a request runs, its worst case is reserved: every input token counted as new, plus the full max_tokens. When it finishes, the reservation is settled on the tokens actually used and the rest is released. Included credits are drawn first, then prepaid credit up to your cap. You are never charged past the cap you authorized, even if a request uses more than its estimate.

Payments

Stripe Checkout funds $10, $25 or $50 prepaid credit. Credit appears only after verified payment. Requests debit prepaid credit only when explicitly authorized. No unlimited allowance.

Monthly plans

Optional and standalone — no AGNT subscription required. POST /hosting/purchase with an Idempotency-Key and a tier of starter, pro or business. The price is debited from prepaid credit, so there is never an automatic card charge. Starter $5 includes 230M credits, Pro $15 includes 700M and Business $39 includes 1,800M. Buying a higher tier mid-month upgrades in place and charges only the difference; moving down happens at renewal. Plans renew only when you enable renewal, and credits never roll over. Past the included credits, authorized requests bill at the usual $0.025 per million.

x402 / USDC on Base

  1. POST /funding/x402 with amountCents and Idempotency-Key using a funding-scoped key.
  2. Read HTTP 402 and the base64 PAYMENT-REQUIRED header.
  3. Authorize exactly the stated USDC amount, destination, chain and validity in your wallet.
  4. POST /funding/x402/:orderId with PAYMENT-SIGNATURE.
  5. Read PAYMENT-RESPONSE and the credited receipt. If pending, poll that order; never pay a second order to recover a timeout.

Models does not hold wallet signing keys. Funding does not authorize unlimited usage.

Limits & retries

  • Context window 1,000,000 tokens; up to 65,536 output tokens per request; up to 512 messages and 256 tool definitions; 4 MB request body.
  • maxChargeMicroUSD: 0 means included-only. Cash also requires account authorization and available account/key budgets. A request whose worst case exceeds 400M credits is rejected before it runs.
  • 120 requests per minute per account, and a limit on how many requests run at once. Exceeding either returns 429; retry after a moment.
  • Requests time out after five minutes; a stream that goes idle for sixty seconds is closed.
  • Failed requests release their reservations and are not charged. Twenty failed attempts in an hour pauses further requests. Reuse the same idempotency key for uncertain retries, never a fresh key.
  • We store receipts, not prompts or replies. A retry returns the receipt and resultRetained:false, without re-running. Save the original reply on your side.

Errors

400 invalid input or unknown model · 401 invalid credentials · 403 insufficient scope · 402 funding/spending limit · 409 conflicting or running request · 429 rate or concurrency limit · 503 unavailable model. Check the stable error code and request receipt before retrying.

Keys

models:execute, models:read and models:fund are independent. Keys last until you revoke them; set an optional expiresAt when creating one if you want a short-lived key. Email sign-in is required to create keys or change spending controls. Never put API secrets in browser pages you publish.

Signed notifications

Register up to three public HTTPS receivers in the app or POST /webhooks. Save the one-time signing secret. Verify X-AGNT-Signature as v1=HMAC-SHA256(secret, timestamp + "." + rawBody), using X-AGNT-Timestamp with a five-minute tolerance. Deduplicate X-AGNT-Event-ID. Delivery is at least once with up to three attempts; history is retained seven days. Notifications contain receipts and state, never prompts or replies.

Privacy & acceptable use

Prompts and completions are processed to produce a reply and are not retained afterwards. They are never used for training. AGNT retains account, payment and request metadata — token counts, credits and charges — for operation and accounting. Avoid sending secrets in prompts. Use the model only for content you are permitted to process; no attempts to extract other customers' data, generate malware or abuse third parties.

Monthly plans are optional and are paid from prepaid credit. Plan and AGNT bundle allowances reset each period; no rollover. Financial records are retained for accounting. Contact support@agnt.gg for account, billing or data requests.

The model name agnt-flash is stable. What serves it may improve over time without changing the name, the API or the price of a credit.

Client downloads

Or use any OpenAI-compatible SDK with base_url https://models.agnt.gg/models/v1. Save each reply when it arrives. Use the same idempotency key for an uncertain retry; receipts do not include previously returned content.

Already subscribe to AGNT?

Paid AGNT already includes monthly credits: Personal 100M, Always On 300M, Business and Enterprise 600M — per UTC month, no rollover. A Models plan can be bought on top, and the larger of the two allowances applies.