API ReferenceHTTP APIAuth
Auth: Create
Create an API key and receive setup transactions.
Alpha Version
The Ostium Builder Service is in Alpha. API endpoints, specifications, and builder URLs may change without notice. Use with caution in production environments.
POST /v1/auth/create
Creates an API key and delegate wallet, then returns setup transactions.
Headers
| Header | Required | Description |
|---|---|---|
X-Trader-Address | Yes | Trader wallet address. |
Response Body
| Field | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | API key for delegated mode. Store securely. |
smartAccountAddress | string | Yes | Smart account address. |
delegateApprovalTx | UnsignedTransaction | Yes | Transaction to delegate trading. |
usdcApprovalRequired | boolean | Yes | Whether a USDC approval is needed. |
usdcApprovalTx | UnsignedTransaction | No | USDC approval transaction (nullable). |
chainId | number | Yes | Chain ID (e.g., 42161). |
UnsignedTransaction
| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Contract address. |
data | string | Yes | ABI-encoded calldata. |
value | string | Yes | ETH value (usually "0"). |
from | string | No | Trader address. |
Example
curl -X POST https://builder.ostiscan.xyz/v1/auth/create \
-H "X-Trader-Address: 0xYourWallet"Example Response
{
"apiKey": "<store-this>",
"smartAccountAddress": "0x...",
"delegateApprovalTx": { "to": "0x...", "data": "0x...", "value": "0", "from": "0x..." },
"usdcApprovalRequired": true,
"usdcApprovalTx": { "to": "0x...", "data": "0x...", "value": "0", "from": "0x..." },
"chainId": 42161
}Notes
- If
usdcApprovalRequiredisfalse,usdcApprovalTxisnull. - If an active delegate wallet already exists for the trader, the request fails.
Errors
See /docs/errors.