Live on Stellar mainnet · v1 API

Argens API Documentation

Argens is a programmable payment infrastructure for AI agents. One API key gives your agent a USDC wallet on Stellar, three human-defined spending rules, cross-chain settlement to Base via CCTP V2, and access to a paid marketplace of 80+ AI services — all without blockchain knowledge.

USDC
only asset in V1
80+
marketplace providers
Stellar
+ Base via CCTP V2
24h
approval window for pauses
Getting started

Quickstart — zero to live in five steps.

No blockchain knowledge required. No SDK to install. Your agent needs nothing but an API key.

01
Create an account

Sign up at argens.xyz. You'll receive a verification email. Argens automatically creates and funds a Stellar wallet with USDC trustline on signup — 2 XLM absorbed on your behalf, nothing to configure.

# After email verification, your wallet is live
GET /v1/wallet/balance
→ { "balance": "0.0000000", "wallet_address": "GXXX...", "currency": "USDC" }
02
Fund your wallet

Send USDC to your Stellar wallet address. Use any Stellar-compatible wallet (Lobstr, StellarX, your exchange's Stellar withdrawal). Argens detects the deposit and emails you a confirmation.

# Your Stellar deposit address (shown in dashboard)
GXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# Minimum deposit: there is no minimum.
# Argens absorbs XLM fees for all outgoing transactions.
03
Set spending policies

Configure three rules in the dashboard: a monthly allowance (total spend cap), a per-transaction maximum (blocks any single large payment), and an approval threshold (pauses payments above a certain size for your review).

# Policy check order — enforced on every /pay call
1. max_transaction_limit  →  per-payment cap, checked first
2. allowance_limit        →  monthly running total
3. approval_threshold     →  pause-for-review above this amount
04
Generate an API key

Go to the API Keys page. Your key has the prefix argns_live_ and is shown once. Argens stores only a bcrypt hash — if you lose it, regenerate. Give the key to your agent as an environment variable.

# Set the key in your agent's environment
export ARGENS_KEY="argns_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Verify it's active
curl https://api.argens.xyz/v1/agent/status \
  -H "Authorization: Bearer $ARGENS_KEY"
05
Make your first payment

Call POST /pay with a Stellar G... address for a direct Stellar payment, or a 0x... EVM address for a cross-chain USDC transfer to Base via CCTP V2. No additional configuration needed.

curl -X POST https://api.argens.xyz/v1/pay \
  -H "Authorization: Bearer $ARGENS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient": "GXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "amount": "5.0000000",
    "currency": "USDC",
    "memo": "hello from my agent"
  }'
Authentication

Two auth paths. Never mix them.

Agent routes use API keys. Dashboard routes use the session JWT. They are separate by design — agent spend and human-initiated spend have different trust models.

Agent API Key
The argns_live_… key is the only credential an agent needs. Pass it as Authorization: Bearer <key>. Never expires unless you explicitly regenerate. Access: /pay, /quote, /agent/status, /transactions, /marketplace/call, /marketplace/services.
Dashboard JWT
Issued on login, expires in 1 hour. Used exclusively by the web dashboard. Manual wallet transfers (/wallet/send) require JWT auth — not callable with an API key. This keeps agent spend and manual transfers on separate audit trails.
curl
CONFIRMED
# Agent auth — works for /pay, /quote, /agent/status, /marketplace/*
curl https://api.argens.xyz/v1/agent/status \
  -H "Authorization: Bearer argns_live_xxxxxxxx"

# → 200
{
  "data": {
    "api_key_status": "active",
    "wallet_balance": "492.5000000",
    "credits_balance": "5.0000000",
    "policies": {
      "allowance_limit": "500.0000000",
      "allowance_remaining": "492.5000000",
      "max_transaction_limit": "50.0000000",
      "approval_threshold": "100.0000000"
    },
    "today_spend": "7.5000000",
    "today_transactions": 3
  }
}
Never log API keys

The key is a credential. Never include it in logs, traces, error messages, or responses. Argens stores only a bcrypt hash — the raw key is unrecoverable after creation.

Store in environment

Set ARGENS_KEY as an environment variable, not hardcoded. For hosted agents, use the secret manager provided by your cloud platform.

Regenerate to rotate

The API Keys page lets you regenerate at any time. The old key is immediately revoked. Keep the new key safe — it's shown once.

Payments

Send USDC to Stellar or Base in one call.

POST /pay auto-detects the destination chain from the recipient address format. A G… address routes to Stellar directly. A 0x… address routes through Circle CCTP V2 and mints USDC natively on Base. Same endpoint — no chain: param needed.

POST /pay
CONFIRMED
# Request
{
  "recipient": "GXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "amount": "25.0000000",
  "currency": "USDC",
  "memo": "optional · max 28 bytes",
  "metadata": {
    "agent_id": "research-agent-01",
    "job_id": "job_abc123"
  }
}

# Response — 200
{
  "data": {
    "status": "success",
    "transaction_id": "cmpn8yh5900011uqz...",
    "stellar_tx_hash": "5d889c269123...",
    "amount": "25.0000000",
    "recipient": "GXXX...",
    "timestamp": "2026-05-27T10:00:00Z",
    "policy_check": {
      "allowance": "passed",
      "max_transaction": "passed",
      "approval_threshold": "passed"
    }
  }
}
Amount format: all amounts are JSON strings with seven decimals — "25.0000000" not 25. This applies to requests, responses, and polling results. Parsing amounts as numbers introduces float errors.
Request fields
FieldTypeDescription
recipientstringStellar G… address (56 chars) for direct Stellar payment, or 0x… EVM address (42 chars) for CCTP Base settlement.
amountstringUSDC amount as a string with 7 decimal places. e.g. "25.0000000". Never a number.
currencystringAlways "USDC" in V1. Required.
memostring?Optional. Max 28 bytes. Included in the Stellar transaction memo field.
metadataobject?Optional. Any JSON object. Stored on the transaction record for your own reference (agent_id, job_id, etc.).
Policy Engine

Three rules. Every payment runs through all three.

Policies are the core of Argens. They run in order — earliest failure wins — on every /pay call and every marketplace call. There is no way to bypass them from the agent side.

Check order — first failure blocks execution immediately
01
Max Transaction
max_transaction_limit

A per-payment hard cap. If the requested amount exceeds this limit, the payment is blocked before the Stellar transaction is even built. No allowance is checked. This runs first so a runaway agent cannot drain your wallet in a single call.

02
Monthly Allowance
allowance_limit

The total USDC your agent can spend in the current period. Checked against policy.total_spent. When exhausted, all further payments are blocked until the next reset or you raise the limit.

03
Approval Threshold
approval_threshold

Payments at or above this amount are paused, not blocked. Argens emails you a magic link to a dashboard confirmation page. The agent polls /transactions/:id. You approve or reject — the payment executes only on explicit approval.

POST /pay — blocked (402)
{
  "error": "Transaction blocked by policy",
  "code": "POLICY_BLOCKED",
  "details": {
    "reason": "max_transaction_exceeded",
    "policy": {
      "max_transaction_limit": "50.0000000",
      "attempted_amount": "75.0000000"
    }
  }
}

# NEVER retry a 402. The payment was blocked by
# policy — not a transient network error. Log it.
POST /pay — pending approval (202)
{
  "data": {
    "status": "pending_approval",
    "transaction_id": "txn_abc125",
    "message": "Awaiting developer approval.",
    "poll_url": "/v1/transactions/txn_abc125"
  }
}

# Agent polls GET /v1/transactions/txn_abc125
# until status is SUCCESS or REJECTED.
# Approval expires after 24 hours.
total_spent tracks the requested amount only. The wallet is debited exactly what you request on direct transfers. Marketplace calls are debited at the cost_paid amount logged on the transaction.
Approval Flow

Human in the loop — without breaking the agent.

When a payment hits the approval_threshold, Argens doesn't fail the request — it pauses it. The agent gets a 202 with a poll URL. You get an email with a one-click confirmation page. The agent resumes when you approve.

Agent calls POST /pay

Amount meets or exceeds approval_threshold. Policy check returns PENDING_APPROVAL.

Argens stores the payment

Transaction created with status PENDING_APPROVAL. A 24-hour single-use token is generated.

Approval email sent

You receive an email with a link to the dashboard confirmation page — not a direct action URL. Email scanners cannot accidentally approve.

Agent polls /transactions/:id
POLLING

The agent polls at a reasonable cadence. Status is PENDING_APPROVAL until you act. No timeout on the agent side — approval can take up to 24h.

You approve or reject

The dashboard shows full transaction detail. You click Approve or Reject. On approval, Argens re-runs the policy check and executes the payment.

Agent receives final status

Next poll returns SUCCESS (with stellar_tx_hash) or REJECTED. The agent continues its loop.

Argens never sends a direct action URL in email. Email clients, Slack previews, and antivirus scanners automatically fetch URLs in emails — a direct GET /approve/:token link would be triggered accidentally. The email contains only a link to the dashboard confirmation page. Approval requires a button click.
Marketplace

80+ AI services. One API key. Zero subscriptions.

Call any enabled provider by service ID. Argens handles the upstream API call, debits the cost from your wallet, runs the full policy check, and logs the transaction. Your agent needs no separate accounts or API keys.

1. Discover services
GET /marketplace/services
# Optional filters
?search=image          search by name or description
?category=vision       filter by category
?enabled=true          only your enabled providers

# Response includes 86 providers
{
  "data": [{
    "provider_id": "flux-schnell",
    "name": "Flux Schnell Image Generation",
    "category": "Vision",
    "enabled": false,
    "skill_url": "/SKILL/flux-schnell.md",
    "endpoints": [{
      "id": "flux_schnell_generate",
      "name": "Generate Image",
      "cost_estimate": "0.0030"
    }]
  }, ...]
}
2. Enable in dashboard, then call
POST /marketplace/call
{
  "service_id": "flux_schnell_generate",
  "payload": {
    "prompt": "isometric city at golden hour",
    "width": 1024,
    "height": 1024
  }
}

# → 200
{
  "data": {
    "status": "success",
    "transaction_id": "txn_k2m9p",
    "service_id": "flux_schnell_generate",
    "cost_paid": "0.0036000",
    "result": { ... upstream response ... }
  }
}
Search
Exa
Perplexity
Tavily
You.com
0.0010–0.002 USDC / call
Vision
Flux Schnell
Flux Dev
DALL-E 3
Fal
0.003–0.05 USDC / call
Compute
E2B Sandbox
Daytona
Modal
Morph
0.005–0.02 USDC / call
LLMs
GPT-4o
Claude 3.5
Gemini
Llama 3
0.001–0.10 USDC / call
Comms
AgentMail
Resend
Courier
Loops
0.002–0.01 USDC / call
Data
Codex GraphQL
CryptoCompare
Twelve Data
0.005–0.02 USDC / call
Skill files per provider. Fetch /SKILL/{provider_id}.md for any enabled provider to get a concise usage reference your agent can load as context before making calls. No external documentation to find.
Marketplace policy note
CONFIRMED

The same three policies — max transaction, allowance, approval threshold — apply to marketplace calls exactly as they do to direct payments. Agents cannot bypass policy limits by routing through the marketplace. The cost_paid field on the transaction record is what policy checks against.

Agent Discoverability

One prompt. Any agent. Under 60 seconds.

The fastest way to onboard an AI agent is to give it the SKILL.md URL as context. The agent reads the full API surface, asks for your key, and is ready to spend. No SDK, no install, no boilerplate.

The one-line onboarding prompt
Works with Claude, ChatGPT, LangChain, CrewAI, any agent that reads a URL
Hi, read https://argens.xyz/SKILL.md and continue with the onboarding steps.
SKILL.md
/SKILL.md

The primary agent onboarding payload. Full API surface, authentication instructions, response shapes, error codes, and amount format rules — all in one file under 6,000 tokens. Versioned.

Provider skill files
/SKILL/{provider_id}.md

Per-provider usage reference for marketplace endpoints. The agent fetches this after discovering a provider in /marketplace/services. Shows exact payload shapes and response formats.

llms.txt
/llms.txt

Discovery index for LLM tools and crawlers. Points to SKILL.md, the docs page, the API catalog, and the provider skill URL pattern. Follows the emerging llms.txt convention.

Response Reference

Every response uses the same envelope.

Success is { "data": ... }. Error is { "error": "...", "code": "...", "details": ... }. No exceptions. The meta field appears on paginated responses only.

success
CONFIRMED
// Single resource
{ "data": { ... } }

// Paginated list
{
  "data": [...],
  "meta": {
    "page": 1,
    "total": 247,
    "pages": 25
  }
}
error
BLOCKED
{
  "error": "Human-readable message",
  "code": "MACHINE_READABLE_CODE",
  "details": {
    // Optional context — field-level errors,
    // policy details, upstream error info, etc.
  }
}

// HTTP status codes:
// 400 — validation error or bad request
// 401 — missing or invalid auth
// 402 — policy blocked (do not retry)
// 404 — resource not found
// 422 — valid request but cannot process
// 429 — rate limit exceeded
// 500 — server error
// 502 — upstream failure (e.g. Stellar)
Transaction record fields
FieldTypeDescription
idstringCUID — the transaction ID. Use to poll for status updates.
statusenumSUCCESS | BLOCKED | PENDING_APPROVAL | APPROVED | REJECTED | FAILED
amountstringRequested amount as a 7-decimal string.
stellar_tx_hashstring?Stellar transaction hash. Present on SUCCESS and cross-chain burn.
destination_chainstring?"base" for CCTP payments. Null for Stellar-only.
destination_tx_hashstring?Base mint transaction hash. Present after successful CCTP relay.
cross_chainbooleantrue when the payment used the CCTP route to Base.
blocked_reasonstring?max_transaction_exceeded | allowance_exceeded — present when BLOCKED.
cost_paidstring?Marketplace only. The total debited from the wallet for this service call.
policy_resultobject?Policy check result stored for audit purposes.
Error Reference

Machine-readable codes for every failure mode.

Every error response includes a code field. Use it to handle failures programmatically — not the human-readable error string, which may change.

CodeHTTPActionDescription
VALIDATION_ERROR400fixRequest body failed schema validation. Check the details field for per-field errors.
INVALID_RECIPIENT400fixRecipient is neither a Stellar G… address (56 chars) nor a 0x… EVM address (42 chars).
INVALID_AMOUNT400fixAmount is not a valid 7-decimal string, or is zero or negative.
UNAUTHORIZED401authAPI key missing, malformed, or not found. Check the Authorization header format.
API_KEY_INACTIVE401authThe API key has been deactivated. Regenerate from the dashboard.
EMAIL_NOT_VERIFIED403authAccount email is not verified. API keys cannot be generated until verified.
POLICY_BLOCKED402no-retryPayment was blocked by policy (max_transaction or allowance). Do not retry automatically.
INSUFFICIENT_BALANCE422no-retryWallet USDC balance is below the requested amount. Fund the wallet first.
SERVICE_DISABLED403dashboardMarketplace provider is disabled. Enable it in the dashboard before calling.
SERVICE_NOT_FOUND404fixservice_id does not match any known endpoint. Check /marketplace/services.
MARKETPLACE_NOT_MPP422upstreamMPP Router rejected the call before payment. No USDC was charged. Check your payload.
CCTP_BURN_FAILED502retryThe Stellar burn transaction failed. No Base relay was started. Check Stellar RPC status.
STELLAR_ERROR502retry-onceStellar submitted the transaction but it failed on-chain. Rare. Check Stellar Explorer.
RATE_LIMIT_EXCEEDED429backoffExceeded 100 requests per minute per API key. Back off and retry.
APPROVAL_EXPIRED400re-submitApproval token is expired (24h window). The agent must re-submit the original payment.
APPROVAL_ALREADY_ACTED400no-retryThe approval token has already been used. Each token is single-use.
Never retry a 402 POLICY_BLOCKED. A 402 means the payment was rejected by the developer's own rules — not a transient network error. Retrying wastes API quota and annoys the developer. Log the error and surface it to the operator.
Limits & Security

Hard limits and security model.

Reference for building robust agents and integrations.

API Limits
FieldTypeDescription
Rate limithard100 requests per minute per API key. Returns 429 when exceeded.
Memo lengthhardMax 28 bytes for Stellar transaction memo.
Pagination maxhardmax limit=100 per page on GET /transactions.
Amount formathardStrings only. 7 decimal places. "25.0000000" — never a number.
Approval TTLhardApproval tokens expire after 24 hours. Single use.
Balance cache TTLsoft30-second cache on /wallet/balance. Live balance on Horizon.
Security model
Agent-custodial

Argens holds your encrypted Stellar signing key so agents can spend autonomously. The key is AES-256-GCM encrypted at rest. You can export it anytime from the dashboard.

No raw key exposure

Secret keys are never returned in responses, never logged, and decrypted only in memory for the duration of signing.

API key storage

Your API key is shown once on creation. Argens stores only a bcrypt hash. The original is unrecoverable — regenerate if lost.

Approval email safety

Magic links go to a dashboard confirmation page, not a direct action endpoint. Email scanners cannot accidentally approve a payment.

Ready to build?

Create a free account, fund a wallet, and your agent can be spending in under 5 minutes. No blockchain knowledge required.