Skip to content
Guides

Conventions

Every endpoint is under https://api.hyperstream.dev/v3/. These docs write paths as /v3/…. The OpenAPI spec lists its server as https://api.hyperstream.dev, with /v3 in each path.

  • Send your API key in the X-API-Key header on every request, from your backend. See API access.
  • Bodies are JSON. Send Content-Type: application/json on POST requests.
  • Requests are strict. A body field or query parameter the route doesn’t take is a 400 VALIDATION_FAILED that names it in field. So a misspelled role is rejected too.
  • Every response carries an x-request-id header. Every error body repeats it as requestId. Log it, and quote it when you contact Khalani.

Chains and assets are named by CAIP ids, the same on every chain family:

What Format Examples
Chain CAIP-2 eip155:42161 (Arbitrum), eip155:8453 (Base)
Asset CAIP-19 eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831 (USDC on Arbitrum)
Native coin CAIP-19 slip44 eip155:42161/slip44:60 (ETH on Arbitrum)

Non-EVM chains use their own CAIP-2 namespaces, and new ones appear as chains are added. Treat ids as opaque strings.

  • Take asset ids from GET /v3/catalog. Don’t build them yourself. The API matches the id it lists.
  • To call an EVM token contract, read it from the id: the address after erc20:. A slip44 id has no contract.
  • The catalog lists a chain’s native coin where it trades. A relay fee names its chain’s native coin by its slip44 id.

An Account is { chain, address }:

{ "chain": "eip155:42161", "address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4" }

Give each address in the chain’s usual format. On EVM the API takes lowercase or checksummed hex and returns it checksummed. On other chains it returns the chain’s canonical form, so compare addresses as the API returns them.

The list filter GET /v3/orders?account=… takes a CAIP-10 account id instead, the chain and address joined by :: eip155:42161:0x5B38Da6a701c568545dCfcB03FcB875f56beddC4.

An AssetAmount is an amount with its asset:

{
"asset": { "id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "chain": "eip155:42161", "symbol": "USDC", "decimals": 6 },
"amount": "100000000"
}
  • amount is a decimal string of integer base units. With 6 decimals, "100000000" is 100 USDC.
  • A request takes the base-unit string alone, next to the asset id: { "asset": "<asset id>", "amount": "100000000" }.
  • Decimals differ between chains, even for the same token. Read decimals from the asset, never assume it.
  • Rates, such as terms.minRate, are decimal strings in whole tokens: destination tokens per source token sent, fees included.
  • Times are RFC 3339 strings in UTC, such as 2026-11-09T20:48:20Z.
  • A transaction is a TransactionRef, { chain, hash }.
  • Response fields are present unless marked optional. null means unknown, not yet, or not applicable.
  • New fields can appear in any response. Ignore fields you don’t know, or a strict response parser breaks on the next release.

Each enumerated field is either closed or open, and the OpenAPI spec says which.

Closed lists hold every value they will ever have: order status and outcome, step id, type and status, receipt observation, obligation kind and status, cancel request status, requirement blocks, and an error’s recovery. Branch on these freely. A value the spec marks reserved isn’t sent yet.

Open lists can gain values: error and problem codes, notice codes, change kinds, action kinds, formats, capabilities, roles, role constraints, actors and a leg’s withoutTx. Show an unknown value as is. Four unknowns change what you may do:

Unknown value What it means
A capability in an option’s requires You can’t use that option.
A constraint on one of an option’s roles You can’t use that option.
A step’s instruction.format You can’t run that step.
The cancel format You can’t cancel early.

Every request is safe to send again, because a repeat never acts twice:

  • A quote option makes one order. Sending the same POST /v3/orders again returns that order.
  • An order has one cancel signature. Sending the same cancel again changes nothing.

So a retry is always safe. Retry after a lost answer or a timeout, and after an error whose recovery is retry. After any other error, change something first, as its recovery says. See Errors and retries.

Revisions let you take breaking changes on your own schedule. A change that could break an integration, such as a renamed field or a new required parameter, ships as a new revision of /v3. Your integration keeps the behaviour it was built against until you update your code and send the new revision.

Send the API-Revision header on every request, set to the revision you built and tested against. That is 0 for an integration built from these docs. Without the header, a request gets the revision that was current when your integration was set up. Sending it makes the pin explicit in your code.

Additive changes reach every revision, because they don’t break an integration that follows these docs: a new response field, a new value in an open list, a new chain or token in the catalog. An unknown revision is a 400 VALIDATION_FAILED naming API-Revision. The curl examples in these docs leave the header out for brevity.