DEVELOPER GUIDE

One API. Your choice of supply.

Connect to authorised marketplace capacity using an Ever AI API key.

1. Create a buyer key

In the buyer workspace, select an available supplier/model, then choose your country, expiry and spending limit. The key uses that supplier’s service credit only. Store it in your application’s server environment. Never include it in browser code.

Requests require an approved supplier, available capacity and verified credit with the selected supplier. Sandbox keys start with eai_sandbox_ and return simulated responses; live keys start with eai_live_. An empty model list means no matching route is available. Listings awaiting review cannot serve requests.

Fund the selected supplier

Choose Buy usage beside an offer. Stripe Checkout shows the supplier receiving your payment. Credit becomes available after server verification, including asynchronous payment confirmation. Balances cannot be transferred between suppliers. Ever AI charges 0%; Stripe processing fees apply to sellers.

Each request reserves its maximum cost from one funding payment, then charges verified token usage. A request must fit within the remaining credit of a single funding payment. Small residual balances remain visible.

2. Discover available models

curl https://everai.exchange/v1/models \
  -H "Authorization: Bearer $EVERAI_API_KEY"

Use an exact model identifier returned by this endpoint. Model availability depends on the permissions of your key and supplier coverage.

3. Connect your application

Choose a language and copy or download the example. These use standard libraries, with no additional SDK required. The supported API is non-streaming text Chat Completions; tools, images and arbitrary provider options are not supported.

Model: your-model-id · Set EVERAI_API_KEY in your server environment. Replace the model with the exact ID assigned to your key.

// Node.js 22+. Set EVERAI_API_KEY in the server environment.
// Maximum reservation: US$0.01 (10000 micros).
const key = process.env.EVERAI_API_KEY;
if (!key) throw new Error("Set EVERAI_API_KEY first.");
const requestId = crypto.randomUUID();
const receiptUrl = "https://everai.exchange/v1/requests?idempotency_key=" + requestId;
console.log("Keep this request ID:", requestId);

try {
  const response = await fetch("https://everai.exchange/v1/chat/completions", {
    method: "POST", redirect: "error", signal: AbortSignal.timeout(60000),
    headers: {
      Authorization: "Bearer " + key,
      "Content-Type": "application/json",
      "Idempotency-Key": requestId,
      "X-EverAI-Max-Cost-Micros": "10000"
    },
    body: JSON.stringify({
      "model": "your-model-id",
      "messages": [
        {
          "role": "user",
          "content": "Hello"
        }
      ],
      "max_tokens": 256,
      "stream": false
    })
  });
  const result = await response.json();
  if (!response.ok) {
    console.error("Request failed:", response.status, result.error?.code);
    throw new Error("Check the request receipt before another inference call.");
  }
  console.log(result.choices[0].message.content);
  console.log("Charge (USD):", result.everai.charged_micros / 1000000);
} catch {
  console.error("No automatic retry. Look up the receipt with the same API key:", receiptUrl);
  process.exitCode = 1;
}

This example sends one request with a US$0.01 spending cap. The cap covers the maximum reservation; actual charges use reported token usage. If the reservation exceeds the cap, the request stops before reaching the supplier. Live keys spend supplier credit; sandbox keys return simulated output. After an error, check the saved request ID before sending another request.

The response reports measured token usage and charged microdollars: 1,000,000 microdollars = US$1. Save the request ID before sending so you can check the receipt after a timeout.

Handle failures without duplicate spending

Use a unique idempotency key for each intended request and keep it with your local request record. Do not automatically retry inference with a new key after a timeout: the supplier may already have processed it. Check your usage ledger and the returned request ID.

StatusWhat to do
401 / 403Check key validity, expiry and model permissions.
402Add or verify credit with the selected supplier. The maximum request reservation must fit in one funding payment.
409The request is already recorded, conflicts with an earlier request, or needs review. Check the error code and ledger.
429Check capacity and key limits before sending another request.
502 / 503Check the error and request ID. An uncertain supplier outcome can keep funds reserved until reviewed.

4. Look up a request receipt

curl "https://everai.exchange/v1/requests?idempotency_key=a-unique-id-for-this-request" \
  -H "Authorization: Bearer $EVERAI_API_KEY"

Use the same key that sent the request. You can also query with request_id instead of idempotency_key. The receipt reports status, charged and reserved microdollars, token usage when confirmed, and UTC Unix timestamps in milliseconds. It does not contain the prompt or response text.

A missing record does not prove a request is safe to resend: it may still be arriving. Check again with the same key. A reconciliation status requires review; reserved and dispatched requests are still in progress. Reading a receipt never calls the model or spends credit. Revoked and expired keys cannot read receipts; the signed-in buyer can still view account history.

Usage records

The Reports workspace exports payments, buyer usage and seller sales for a selected UTC date range. Download successive parts of up to 1,000 records to retrieve older history. A new download fixes the creation-time cutoff; statuses reflect when each part is downloaded. Amounts are integer USD microdollars (1,000,000 = US$1); payment amounts are cents (100 = US$1). Exports include request identifiers, immutable rates, token counts, status and timestamps. They contain no prompts or provider credentials and are activity reports, not tax invoices.

Supplier availability

Ever AI periodically checks active supplier connections using their model-list endpoint, without generating AI requests. A rejected key or unavailable model pauses that listing. Sellers can check or replace their key and resume eligible supply in the seller workspace. These checks do not guarantee availability for every request.

Sellers can also disconnect an API key to remove it from the saved connection and stop new requests. Requests already sent may finish and be charged; payment and usage records remain. Disconnecting does not revoke the key at its provider. Reconnecting requires a new model-access check.

Hosted chat with your own API key

Open the chat workspace, connect your own OpenAI API key, acknowledge separate API billing and select a text model. Your key is encrypted and restricted to your signed-in account. Messages go to the official OpenAI Responses API through Ever AI. No local relay is required. API charges are billed by OpenAI; ChatGPT subscription allowances and marketplace balances are separate. Disconnect deletes your stored key. A request already running may finish.

Your own ChatGPT plan

The personal relay runs on your computer at http://127.0.0.1:48771 and uses its own local key and streaming Responses API. Each person connects their own plan. Marketplace keys, balances and supplier routes are separate from the personal relay.