Skip to content

AgentWifi developer platform

الوثائق

Use a Workspace API key to discover available tools, inspect credits, and execute published capabilities through MCP or REST. Both transports share authentication, server capabilities, limits, idempotency, billing, fallback, and request facts.

01

Start with a Workspace key

Sign in to Console, create a key, save the plaintext once, and use the exact HTTPS endpoint shown by Quick Start.

Endpoint placeholder

Examples use https://api.example.com only as a placeholder. Replace the origin with the deployment endpoint shown in Console; keep the documented /v1 paths unchanged.

curl --fail-with-body --silent --show-error 'https://api.example.com/v1/catalog?availableOnly=true&category=web&limit=5' \
  --header 'Authorization: Bearer <YOUR_WORKSPACE_API_KEY>'

02

Bearer only, never URL or Cookie authentication

Every MCP and REST request requires Authorization: Bearer YOUR_WORKSPACE_API_KEY. Session cookies authenticate Console only and are rejected by the data plane. Query-string keys are rejected.

The plaintext key is returned only once at creation. Do not put it in URLs, prompts, chat, screenshots, source control, shell history, or logs. Revoke a key immediately if it may have leaked.

03

Remote Streamable HTTP MCP

The MCP endpoint accepts POST requests and supports initialize, tools/list, and tools/call. It is stateless in the first release.

Initialize the connection

curl --fail-with-body --silent --show-error 'https://api.example.com/v1/mcp' \
  --header 'Authorization: Bearer <YOUR_WORKSPACE_API_KEY>' \
  --header 'Accept: application/json, text/event-stream' \
  --header 'MCP-Protocol-Version: 2025-03-26' \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"agentwifi-docs-smoke","version":"1.0.0"}}}'

Five published MCP tools

ToolServer capabilityInput contract
list_tools

List published tools from the current catalog snapshot

catalog:readprefix, query, category, provider, source, availability, availableOnly, maxCreditsPerCall, cursor, limit
find_tools

Find published tools using semantic and keyword search

catalog:readquery, limit
describe_tool

Return the published contract for one canonical tool

catalog:readcanonicalName, version
execute_tool

Execute one published canonical tool contract

tools:executecanonicalName, version, params, maxCredits, idempotencyKey
account

Return the current workspace balance and provider health

account:readverificationCode

tools/list JSON-RPC payload

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/list",
  "params": {}
}

04

REST endpoints

REST is an HTTP adapter over the same Catalog, Account, and Execute application services used by MCP. Unknown or repeated query parameters and extra execute body fields fail validation.

Method and pathServer capabilityPurposeParameters
GET /v1/catalogcatalog:readList the complete published catalog with stable pagination and facets.
prefix Canonical-name prefix.
query Full-text catalog filter.
category Exact category filter.
provider Exact provider slug filter.
source Exact data-source filter.
availability available, unavailable, or deprecated.
availableOnly true returns only entries with a published executable route.
maxCreditsPerCall Maximum per-call cost as canonical decimal credits.
cursor Opaque cursor returned by the previous page.
limit 1-100; defaults to 20.
GET /v1/catalog/searchcatalog:readFind published tools using semantic search with keyword fallback.
query * Search text, 1-500 characters.
limit 1-50; defaults to 10.
GET /v1/catalog/:canonicalNamecatalog:readDescribe one published canonical tool contract.
version Exact published version.
GET /v1/accountaccount:readRead the authenticated Workspace balance and provider-health summary.None
POST /v1/executetools:executeExecute one available published tool through the shared data plane.canonicalName, version, params, maxCredits, idempotencyKey

Contract-checked examples

Find tools

curl --fail-with-body --silent --show-error 'https://api.example.com/v1/catalog/search?query=latest%20AI%20news&limit=3' \
  --header 'Authorization: Bearer <YOUR_WORKSPACE_API_KEY>'

Execute with a replay key

curl --fail-with-body --silent --show-error 'https://api.example.com/v1/execute' \
  --header 'Authorization: Bearer <YOUR_WORKSPACE_API_KEY>' \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{"canonicalName":"web.search","params":{"query":"latest AI news"},"maxCredits":"1","idempotencyKey":"docs-web-search-001"}'

05

Catalog facts are stable and fail closed

The Catalog returns the complete published snapshot. availability describes the versioned product state; executionAvailable additionally requires at least one enabled published route. Only entries where both are usable can execute.

Treat nextCursor as opaque. It binds the snapshot and every filter, including availableOnly. Replaying it with different filters is rejected. A missing cursor means the final page.
Use availableOnly=true when you need entries that can execute now. Provider health does not rewrite Catalog availability, and unavailable or deprecated entries remain non-executable even if a UI is bypassed.

06

Account reads the immutable Ledger balance

GET /v1/account and the MCP account tool return the API key's Workspace and balance. availableCredits can be reserved for a call, reservedCredits is currently held, and totalCredits is their sum. Credits are canonical decimal strings, never floating-point values.

Execution reserves an upper bound, then settles actual usage or releases the reservation. The Ledger is the only balance source of truth; Provider output and client-side totals cannot mint or rewrite credits.

07

Replay safely; cancel deliberately

Idempotency

Set idempotencyKey on execute (8-255 characters) and reuse it only for the same logical request. The key is shared across MCP and REST: retrying through either transport returns the same execution fact instead of charging or calling a Provider twice.

Deadline and cancellation

Each execute has one server deadline across at most two Provider attempts. A client disconnect or AbortSignal cancels work; REST reports CANCELLED with HTTP 499 when a response can still be returned, while deadline expiry reports HTTP 504. Permits and active reservations are released on terminal paths.

Rate and concurrency

All authenticated requests consume per-key and per-Workspace rate capacity. Execute also uses per-key/per-Workspace concurrency and a Provider bulkhead. Saturation returns HTTP 429, RATE_LIMITED, retryAfterMs, a scope, and Retry-After in whole seconds. Retry-After is a backoff hint, not a queue promise.

Current rate, concurrency, and Provider bulkhead backends are in-memory and guarantee atomic limits only inside one API process. A multi-instance deployment must replace them with a shared atomic backend before claiming global limits.

08

Stable errors and request correlation

Route, authentication, validation, availability, and admission failures use the envelope below and return the same requestId in X-Request-Id. Execute failures return the typed ExecutionResult with status=failed and the same stable error metadata.

{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Request rate limit exceeded",
    "retryAfterMs": 1000,
    "scope": "api_key_rate"
  },
  "requestId": "req_example_01"
}
CodeHTTPRetry
VALIDATION_ERROR400No
UNAUTHENTICATED401No
INSUFFICIENT_CREDITS402No
FORBIDDEN403No
NOT_FOUND404No
TOOL_UNAVAILABLE409No
RATE_LIMITED429Yes, with policy
CANCELLED499Yes, with policy
UPSTREAM_UNAVAILABLE502Yes, with policy
CATALOG_UNAVAILABLE503Yes, with policy
DEADLINE_EXCEEDED504Yes, with policy
UPSTREAM_TIMEOUT504Yes, with policy
INTERNAL_ERROR500No

09

Verified Agent targets, not a wish list

This matrix is generated from the versioned client registry. Available means at least one exact target and method has PASS evidence; it does not cover unlisted operating systems, architectures, methods, or future client versions.

Windows is deferred and unavailable. Cursor, OpenClaw, Qoder, and WorkBuddy have no verified target. Prompt install is verified only for Codex on macOS arm64 at the registry-pinned versions; do not reuse it elsewhere.
AgentStatusVerified targets and methods
Codex
codex
Available in the listed scope
  • macos/arm64 script + Prompt
  • macos/x64 script
  • linux/arm64 script
  • linux/x64 script
Claude Code
claude-code
Available in the listed scope
  • macos/arm64 script
  • macos/x64 script
  • linux/arm64 script
  • linux/x64 script
Cursor
cursor
Unavailable / deferredNo verified target
Gemini CLI
gemini-cli
Available in the listed scope
  • macos/arm64 script
  • macos/x64 script
  • linux/arm64 script
  • linux/x64 script
OpenCode
opencode
Available in the listed scope
  • macos/arm64 script
  • macos/x64 script
  • linux/arm64 script
  • linux/x64 script
OpenClaw
openclaw
Unavailable / deferredNo verified target
Hermes
hermes
Available in the listed scope
  • macos/arm64 script
  • macos/x64 script
  • linux/arm64 script
  • linux/x64 script
Qoder
qoder
Unavailable / deferredNo verified target
WorkBuddy
workbuddy
Unavailable / deferredNo verified target
Kimi CLI
kimi-cli
Available in the listed scope
  • macos/arm64 script
  • macos/x64 script
  • linux/arm64 script
  • linux/x64 script

For installation commands and an authenticated account probe, use Console Quick Start. It exposes only methods verified for the selected target.

Protocol and compatibility facts on this page are generated from the contracts and client registry consumed by the running surfaces.
AgentWifi API documentation | AgentWIFI