aixyz.config.ts
Every aixyz project requires an aixyz.config.ts at the project root. This file defines your agent’s identity, payment settings, and skills. It is validated at build time using Zod schemas from @aixyz/config.
Config Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Agent display name |
description | string | Yes | What the agent does |
version | string | Yes | Semver version |
url | string | No | Agent base URL (auto-detected on Vercel) |
x402.payTo | string | Yes | EVM address to receive payments |
x402.network | string | Yes | CAIP-2 chain ID (e.g. eip155:8453) |
skills | AgentSkill[] | Yes | Skills exposed in the A2A agent card |
AgentSkill
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique skill identifier |
name | string | Yes | Skill display name |
description | string | Yes | What the skill does |
tags | string[] | Yes | Categorization tags |
examples | string[] | No | Example prompts |
inputModes | string[] | No | Input MIME types |
outputModes | string[] | No | Output MIME types |
URL Resolution
Ifurl is omitted, it is auto-detected in the following order:
https://${VERCEL_PROJECT_PRODUCTION_URL}(Vercel production)https://${VERCEL_URL}(Vercel preview)http://localhost:3000(fallback)
Payment Networks
| Network | CAIP-2 ID |
|---|---|
| Base | eip155:8453 |
| Base Sepolia | eip155:84532 |
| Ethereum | eip155:1 |
Accepts
Theaccepts named export on agents and tools controls x402 payment gating:
"$0.005", "$0.01", "$0.0001".
Environment Variables
Environment files are loaded in Next.js order:process.env → .env.$(NODE_ENV).local → .env.local → .env.$(NODE_ENV) → .env
| Variable | Description |
|---|---|
OPENAI_API_KEY | OpenAI API key |
X402_PAY_TO | Default payment recipient address |
X402_NETWORK | Default payment network |
X402_FACILITATOR_URL | Custom x402 facilitator URL |
CDP_API_KEY_ID | Coinbase CDP key ID (switches to Coinbase facilitator) |
CDP_API_KEY_SECRET | Coinbase CDP key secret |
STRIPE_SECRET_KEY | Experimental Stripe adapter |
STRIPE_PRICE_CENTS | Stripe price in cents (default: 100) |
Build-Time vs Runtime Config
@aixyz/config exposes two functions:
| Function | Usage | Description |
|---|---|---|
getAixyzConfig() | Build-time | Full config including all fields for the build pipeline |
getAixyzConfigRuntime() | Runtime | Subset safe for inclusion in runtime bundles |
AixyzConfigPlugin build plugin materializes the resolved config into the bundle, replacing aixyz/config imports so the runtime bundle does not need the config file.