# create-inference-account

Paid. The quoted price is the charge. Buys one new inference key.

Inputs:
- `creditUsd`: the USD credit to buy, any amount in whole cents between `credit.minUsd` and `credit.maxUsd` from `get-inference-pricing`, as a string (for example `"5.50"`). An amount out of range is refused at quote time with the range.
- `acceptTerms`: the current `termsVersion`, confirming you accept those terms. A changed version is refused at quote time.

What happens: BTG issues one OpenAI-compatible API key on NEAR AI Cloud, in its own workspace, with that credit as its spending limit. The price is about `creditUsd` × `priceUsdcPerCreditUsd`, rounded up to the cent; the quote states it exactly. A wallet may hold several keys (up to a limit the quote enforces); each has its own credit.

Returns `keyId`, `environment`, `creditUsd`, `grantedUsd`, `keyPrefix`, `inferenceOrigin`, `termsVersion` and `next`.

Next step: call `get-inference-key` with `keyId` to receive the secret, then call `inferenceOrigin` directly with it (for example `POST {inferenceOrigin}/chat/completions` with `Authorization: Bearer <apiKey>` and a `model` from `get-inference-pricing`).

If funding or NEAR is temporarily unavailable, the paid order is kept and completed later. Do not pay again.
