Skip to content
KYZEN DOCUMENTATIONLaunch app

DocsGuides

Use the Gateway

Top up, sign for a key, make a first request and read your usage.

#You need

  • A wallet connected on Robinhood Chain
  • $KYZN in that wallet, to top up the Gateway balance
  • ETH for gas: the top-up is one transaction, the key one signature
  • A visit from outside the United States, Canada, the United Kingdom and Switzerland
  • For the first request: curl, or Python or Node.js with the openai package (pip install openai, npm i openai)

Prices, limits and the burn, in full: Gateway.

#Top up

  1. 01
    Send $KYZN to the Gateway
    Open Gateway in the app. The Balance card shows your Gateway balance, the $KYZN Held now for requests in flight, and the Price per $KYZN. Enter an amount in Amount to send and press Send $KYZN to the Gateway. The wallet asks for one transaction: a $KYZN transfer to the Gateway contract.
    The Balance card: Gateway balance 0 $KYZN, Held now a dash, Price $0.000000013169 per $KYZN, and the empty Amount to send field outlined, with the wallet balance of 3,525,000 $KYZN above it.
    Test amounts on Robinhood Chain testnet.
  2. 02
    Wait ten blocks
    The line reads Sent 50,000 $KYZN to the Gateway. It is credited to this wallet once the transfer is ten blocks deep. Then Gateway balance shows the credit. The Gateway credits the wallet that sends, so send from the wallet the key belongs to. $KYZN routed into the contract straight from a pool buy is not credited.
    Gateway balance 50,000 $KYZN outlined after the credit, above the status line Sent 50,000 $KYZN to the Gateway. It is credited to this wallet once the transfer is ten blocks deep. Transaction 0x9dad·f437.
    Test amounts on Robinhood Chain testnet.

#Get a key

  1. 03
    Sign for a key
    The API key card lists the three steps: sign one message, send $KYZN, pay per request. Press Sign to issue API key and sign the message in the wallet. It is a signature, not a transaction, so it costs no gas. A wallet holds at most 5 active keys.
    The API key card with its three steps, Sign one message, Send $KYZN and Pay per request, and the Sign to issue API key button outlined.
    Test amounts on Robinhood Chain testnet.
  2. 04
    Copy the key once
    The key appears in a box marked API key · shown once. Press Copy and store it where you keep passwords. The app never shows it again; a new signature issues another.
    The box API key · shown once, the key hidden in this capture as kyzn_ followed by dots, and the Copy button outlined; below, the note to store the key like a password.
    Test amounts on Robinhood Chain testnet.

#First request

  1. 05
    Send a request

    Keep the key in an environment variable, KYZN_KEY, so it never sits in code. The API follows OpenAI’s, so OpenAI’s client libraries work with the base URL https://app.kyzen.network/v1. The JavaScript sample is an ES module with top-level await: save it as a .mjs file and run it with Node.js.

    First request
    curl https://app.kyzen.network/v1/chat/completions \
      -H "Authorization: Bearer $KYZN_KEY" \
      -H "Content-Type: application/json" \
      -d '{"model":"pro","messages":[{"role":"user","content":"Which stage binds?"}]}'
TierModel id
Propro
Flashflash

The Gateway lists its models, with each one’s price per million tokens in dollars and in $KYZN, at /v1/models, with no key.

List the models
curl https://app.kyzen.network/v1/models

Each request is charged from the host’s token counts at the host’s dollar rate plus 10%, in $KYZN at the median pool price of the last 15 minutes. With no fresh price, nothing is charged.

StatusCodeMeaning
401invalid_api_keyThe key is missing, wrong or revoked
402insufficient_balanceThe Gateway balance cannot cover the request: top up in the app
403region_closedThe request comes from a closed country
403region_unconfirmedThe region cannot be confirmed: try again later
404model_not_foundThe model id is not offered: see /v1/models
429rate_limit_exceeded60 chat completions in the last minute from this wallet
429too_many_in_flight4 chat completions from this wallet already running
503price_unavailableNo fresh $KYZN price: nothing is charged; try again shortly

#Read usage

  1. 06
    Read the usage table
    In the app, Usage · Recent requests lists the wallet’s latest requests: Model, Tokens in, Tokens out and Charge in $KYZN. The app reads it with the key it issued, so the table shows while that page stays open. The capture shows testnet’s stand-in model; on mainnet the Model column names the tier id, pro or flash.
    The Usage table, Recent requests: one request to the testnet stand-in model, 12 tokens in, 20 tokens out, charged 3,842.3571 $KYZN.
    Test amounts on Robinhood Chain testnet.
  2. 07
    Read it with the key

    Any time, /v1/account with the key gives the Gateway balance, the $KYZN held, the active keys, recent deposits and up to 50 recent charges, each with its model, token counts, charge and time.

    Account
    curl https://app.kyzen.network/v1/account \
      -H "Authorization: Bearer $KYZN_KEY"

Prompts and answers are never stored or logged. Usage records keep the key, the model, the token counts, the charge and the time.

Esc
  • OverviewGet started
  • Quick startGet started
  • Wallets and networkGet started
  • Where the app opensGet started
  • GuidesGuides
  • Buy $KYZNGuides