# Access & auth
Source: https://docs.geckovision.tech/access-and-auth
The whole engine/adapter seam is one function — Session.auth_headers(). How Gecko handles auth and paywalls invisibly to the agent.
Auth is invisible to the agent. The agent describes intent; Gecko injects
credentials at call time.
The entire engine/adapter seam is **one function**:
```python theme={null}
class AuthSession(Protocol):
def auth_headers(self) -> dict[str, str]: ...
```
Any object with `auth_headers() -> dict[str, str]` is a valid session. A paywalled API
returns its tokens; a public API returns an empty dict. This is the design that keeps
the engine **API-agnostic** — adding an API is data (the spec) plus, at most, this one
adapter.
## Sessions you get out of the box
A two-token authenticated session (JWT + API token). Returned by the access
handshake.
For public, no-auth APIs — `auth_headers()` returns an empty dict.
A non-live session for recorded demos: auth headers are present but not real.
## Store your keys safely — the credential resolver
You don't have to hand-write a `Session`. Gecko ships a credential resolver that keeps
provider secrets in your **OS keychain** and injects them at call time — the key never
enters the agent's context, shell history, a dotfile, or a log, and **it never leaves
your machine**.
```bash theme={null}
gecko auth set colosseum # hidden prompt — paste the key; it goes to your OS keychain
gecko auth list # names only, never values
gecko auth test colosseum # reports which backend answered — never the value
gecko auth rm colosseum # remove
```
The resolver tries, in order: your **OS keychain** → an external secret-manager command
(`op` / `vault` / `pass`) → an environment variable (CI/headless). For CI, just
`export COLOSSEUM_COPILOT_PAT=...`.
**Local vs hosted.** Because the key stays on *your* machine, an API that needs *your*
key runs **locally** (`gecko auth set …` then serve it). The hosted
`mcp.geckovision.tech` serves only the **public** surfaces — Gecko never holds a user's
key, so a keyed, per-person API can't be a shared hosted surface.
## How auth gating works
When a session returns an **empty** auth-header dict, Gecko treats it as "this
session can't satisfy auth-gated operations" and **hides those operations from the
agent** — it could only mis-call them. A session *with* auth surfaces everything,
unchanged. If an auth-gated tool is forced anyway, `prepare()` raises a typed error
rather than firing a request that can't succeed.
```python theme={null}
from gecko.access import public_session
from gecko.client import AgentApiClient
client = AgentApiClient(spec, session=public_session())
client.list_tools() # auth-gated operations are not in this list
client.prepare("some_auth_only_op", {}) # raises CallError — correctly refused
```
## The two-token handshake (worked example)
The live reference integration (the TxODDS World Cup API) uses a flow the agent never
has to learn. Gecko encodes it so the agent only ever describes intent:
```
guest JWT → on-chain subscribe (txSig) → sign(txSig:leagues:jwt) → activate → apiToken
```
producing a two-token session:
```
Authorization: Bearer (httpAuth)
X-Api-Token: (apiKeyAuth)
```
Transport and signer are **injected**, so the whole flow is unit-testable with no
network and no keys:
```python theme={null}
from gecko.access import establish_session
session = establish_session(base_url, tx_sig, leagues, signer=my_signer)
session.auth_headers()
# {"Authorization": "Bearer ...", "X-Api-Token": "..."}
```
## The on-chain step
The `subscribe` transaction itself is a wallet-signing, network-specific step that
lives outside the access layer (in `scripts/`). The access layer takes the resulting
`txSig` plus a signer and finishes the session.
**Mainnet boundary.** The subscribe transaction is **founder-run only**. The tooling
*simulates* by default (no spend) and hands over the exact command; a human broadcasts
it. Gecko does not sign or broadcast mainnet transactions on its own.
## Short-lived tokens & OAuth — auto-refresh
Most production APIs hand you a **short-lived access token plus a refresh token**
(the OAuth pattern). Gecko manages that lifecycle for you, behind the same
`auth_headers()` seam — the agent never sees an expiry:
* **Proactive refresh** — when the token is within a leeway window of expiry, the
session refreshes it *before* returning headers.
* **Reactive self-heal** — if a live call still comes back `401`, Gecko re-authenticates
and retries the identical call **once** (bounded — a second failure raises a typed,
redacted error, never an infinite loop).
You do the one-time interactive login yourself (Gecko can't complete a human's 2FA);
after that, Gecko takes over. `OAuth2Lifecycle` refreshes via a `refresh_token` grant,
and adapters like `oauth2_from_dpo2u()` read a local token file and refresh on their own.
```python theme={null}
from gecko.access import oauth2_from_dpo2u # reads ~/.dpo2u/oauth.json, refreshes at the token endpoint
session = oauth2_from_dpo2u()
session.auth_headers() # a valid Bearer token — refreshed transparently as it nears expiry
```
The refresh token (a secret) resolves through the credential resolver in your local
runner; the short-lived access token lives in memory only. Nothing about the token is
persisted by Gecko's control plane.
## What Gecko never does with credentials
* It never exposes auth headers in the agent-facing tool definitions.
* It never logs tokens or keys — secrets are redacted before any error is raised.
* Its **control plane** never stores or transmits your secret: the credential resolver
reads it from your local OS keychain (or env) and injects it at call time, on your
machine. Gecko only ever sends it toward the API's own host — never anywhere else.
See [Architecture](/architecture) for how this fits the control-plane model.
# Architecture
Source: https://docs.geckovision.tech/architecture
The three views (context engineering, the full pipeline, and the proven on-chain loop) plus the invariants and the one API-agnostic seam.
Gecko is a **control plane, not a data plane.** It holds the API's *surface*, the
generated tool defs, and *correctness metadata*, never the data flowing through. That
single invariant is what makes the rest of the design coherent.
Below: the same system in three views. Each has a static diagram and an interactive
version you can pan, filter, and click through.
***
## View 1: Context engineering (the memory substrate)
Gecko is **not the agent**. It is the memory-and-context substrate *under* other
people's agents. Every block of the canonical agent-memory architecture exists here, and
three of them are deliberately different from the textbook.
| Block | What Gecko does | Why it differs |
| --------------------- | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **Semantic memory** | comprehended surfaces + a lexical, token-overlap catalog | the graph never *approximately* remembers; BM25 and vector tiers both sit behind evidence gates that flip only on measured recall failure |
| **Procedural memory** | question-shaped tool defs (auth stripped) + typed plans (`landing_plan`, `derivation_order`) | plans are **executable JSON** a builder can run; text loses the join, typed data can't |
| **Episodic memory** | a categorical corpus (closed vocabularies, never payloads) + an N-confirmed drift series | Gecko **generates its own episodes** by re-simulating; no dependence on your data plane |
| **Working memory** | just-in-time projection: scale-adaptive tool listing, full defs withheld above scale and recovered per tool on demand | measured context cuts of **−77% / −89%** on two real specs (bytes measured, tokens estimated) |
Retrieval quality is fed by a misrank-aware evaluation: a golden set plus a closed
miss-cause vocabulary, so the lexical-vs-semantic gate gets data instead of a guess.
The diagram above is a render. The **interactive** version (pan, zoom, guided
views, PNG/SVG export) ships in the repo as a single self-contained file:
[`docs/assets/architecture-context.html`](https://github.com/GeckoVision/gecko-surf/blob/main/docs/assets/architecture-context.html).
Download it and open it locally; it needs no server and no network.
***
## View 2: The full pipeline (sources → knowledge → action)
OpenAPI, human docs, `llms.txt`, Anchor IDLs, raw program source (Steel and native
too), and a 4,500-project on-chain catalog. Everything ingested is treated as
hostile input.
Spec sanitizer, per-tool quarantine, image Skill Guard (rendered-pixel payloads and
encoded-content rescan), SSRF netguard, out-of-band auth-host anchoring. Fail-closed.
Ingest to normalized `Operation` / `Param`; PDA seed recovery from IDL **and** source
(source rescues what the IDL structurally drops); auto-comprehend on pick, which
emits a generated config plus a **measured overlay** of what could not be derived
from any public surface.
Surface graph: `EXTRACTED` > `DECLARED` > `INFERRED` > `CLAIMED` → `VERIFIED` /
`REFUTED`. Program graph: `EXTRACTED` / `RECOVERED` / `FLAGGED`. Cross-API
correlations join on **declared** value domains first.
MCP (hosted, stdio, npx/uvx), the CLI, the Scorecard, and the Playground.
Auth headers never appear in a tool def.
`plan_*` returns the full account set plus state-read args and landing preludes → an
**external builder** builds → Gecko simulates the exact bytes → a **Receipt** with a
`binding` over those bytes → an **external signer** (wallet / TEE / human) signs →
`verify_signed_transaction` proves the signed bytes are the checked ones →
`submit_transaction` relays them, and refuses anything that does not verify.
A categorical outcome (never a payload) can be recorded on explicit opt-in, feeding
the drift series, which feeds back into the graph.
**The hard boundaries:** Gecko never signs, never holds a key, never proxies the data
plane. Building and signing belong to compose partners. That is the design, not a gap.
The one send path it ships relays only signed bytes that verify against its own binding.
The diagram above is a render. The **interactive** version (pan, zoom, guided
views, PNG/SVG export) ships in the repo as a single self-contained file:
[`docs/assets/architecture.html`](https://github.com/GeckoVision/gecko-surf/blob/main/docs/assets/architecture.html).
Download it and open it locally; it needs no server and no network.
***
## View 3: The on-chain action path (the proven loop)
1. **Intent**: "buy this token", "swap SOL for USDC on this pool".
2. **Derive** the full account set, including accounts the IDL hides
(`bonding_curve_v2`) and seeds recovered from source (`base_factor`).
3. **State reads** (control plane) for sane arguments, e.g. curve reserves →
`max_sol_cost`.
4. **External build**: the plan goes to the builder; the builder returns the instruction.
5. **Unsigned prelude assembly**, for simulation only: idempotent ATA creation, wSOL
wrap/unwrap, compute budget. On the money paths, a fresh blockhash is patched in at
the offset the layout dictates, so the simulated bytes are the bytes handed back.
6. **Simulate**: `simulateTransaction` with `sigVerify:false`, on a fork or against a
public mainnet RPC.
7. **Receipt + binding**: status, categorical revert class, compute units, and a hash
over the exact message bytes at `exact` strength. → [The Receipt](/receipt)
8. **External signer** signs. Then `verify_signed_transaction` checks the signed bytes
against the binding, and `submit_transaction` relays them only if that check passes.
Gecko never signs. Unsigned assembly for simulation is the one documented carve-out, and
it is enforced at the landing layer by an AST check that proves that layer contains no
signing or sending path. The one sending path, `submit_transaction`, lives outside it and
is structurally unable to relay bytes without a binding.
The diagram above is a render. The **interactive** version (pan, zoom, guided
views, PNG/SVG export) ships in the repo as a single self-contained file:
[`docs/assets/architecture-onchain.html`](https://github.com/GeckoVision/gecko-surf/blob/main/docs/assets/architecture-onchain.html).
Download it and open it locally; it needs no server and no network.
***
## Invariants
Stores the API surface, tool defs, and correctness metadata only, never response
payloads, user data, or secrets.
Everything API-specific reduces to data (the spec) plus one adapter seam,
`Session.auth_headers()`. Adding an API doesn't touch ingest/catalog/tools/caller.
`recorded` and `live` differ only at the transport edge. The free offline
simulation comes first; live smoke is the final check.
Tool defs never expose auth headers. The agent describes intent; Gecko injects
credentials at call time from your OS keychain.
No keypair on any path. The landing layer has no sign or send path, AST-enforced.
`submit_transaction` relays only signed bytes that verify against a Gecko binding.
Unknown facts are `FLAGGED`, not invented. Below the retrieval floor the answer is
an honest no-start.
## Module map
The comprehension logic is the product and lives in the package; the MCP server, the
client, and the scripts are thin transport.
| Module | Responsibility |
| ----------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `gecko/ingest.py` | OpenAPI 3.x → normalized `Operation` / `Param` (`$ref` resolution, cycle/depth guarded) |
| `gecko/catalog.py` | Lexical capability search (intent → endpoint) |
| `gecko/tools.py` | `Operation` → question-shaped agent tool defs (**auth hidden**) |
| `gecko/caller.py` | tool + args → correct `PreparedRequest` (stdlib `urllib`) |
| `gecko/access.py` | `Session.auth_headers()`, the engine/adapter seam |
| `gecko/provenance.py` | the one canonical provenance vocabulary, shared by both graphs |
| `gecko/program_graph.py`, `gecko/pda.py` | the on-chain instruction↔PDA graph and derivation order |
| `gecko/find_start.py` | intent → the right (program, instruction) start point |
| `gecko/simulate.py` | the simulate→**Receipt** engine |
| `gecko/prepare_purchase.py`, `gecko/prepare_instruction.py` | plan, build once, simulate the exact bytes, return them unsigned with the binding |
| `gecko/verify_signed.py`, `gecko/submit_transaction.py` | signed bytes against the binding; relay-and-rebroadcast, refused without a binding |
| `gecko/corpus.py`, `gecko/drift.py` | categorical outcomes and the N-confirmed drift series |
| `gecko/sample.py` | deterministic schema → example (powers \$0 recorded mode) |
| `gecko/client.py` | `AgentApiClient`: `search` / `list_tools` / `prepare` / `call` |
| `gecko/mcp_server.py` | `McpSurface`, the agent-facing MCP surface |
## The one seam that matters
Adding a new API should not require touching ingest, catalog, tools, or the caller. The
only API-specific code is, at most, an auth adapter, an object that implements:
```python theme={null}
def auth_headers(self) -> dict[str, str]: ...
```
A public API uses the built-in no-auth adapter (returns `{}`); a paywalled API supplies
a session that returns its tokens. See [Access & auth](/access-and-auth).
## Security posture
* Ingested spec, doc, IDL, and source content is treated as **untrusted input**.
* URLs are validated before fetching (no SSRF: private/loopback/link-local ranges and
non-http schemes blocked). A caller-supplied `rpc_url` goes through the same guard.
* Secrets resolve from the OS keychain at call time and are never logged or persisted;
errors redact tokens before they're raised.
* Seven fail-closed security layers: spec sanitizer · per-tool quarantine · image Skill
Guard · SSRF netguard · out-of-band auth anchoring · the signing gate that checks
signed bytes against the receipt's binding · the AST-enforced no-sign boundary on the
landing layer.
The agent-readable version of this page is
[`architecture.llms.txt`](https://github.com/GeckoVision/gecko-surf/blob/main/architecture.llms.txt)
in the engine repo: the same three views plus the honest works / not-built split. See
also [Status](/status).
# Cloud
Source: https://docs.geckovision.tech/cloud
The free gecko-surf engine makes any API agent-usable and stays free forever. Cloud is the hosted, always-correct layer API providers pay for — and you pay only when it scales.
**The engine is free and stays free.** Everything that makes an agent call an API
correctly the first time is in the open-source `gecko-surf` you run yourself — no
account, telemetry off by default. **Cloud** is what we're **building on top**: the
hosted, continuously-correct, cross-customer layer. This page describes what it does.
## Who pays, and why
One sentence: **the engine is free forever for builders; API providers pay a flat
per-API subscription for hosted, drift-watched, agent-ready surfaces.**
The free engine is the **funnel**: any developer points it at any API and gets
first-call-correct tools, forever, on their own machine — builders never pay. **Cloud is
where API providers pay** — to make *their* API the one agents call correctly, keep it
correct as it drifts, and turn more correct calls into more usage (and, connected to their
payment rail, more revenue). A provider starts free and steps up **as their API scales
with agents** — the tiers below are performance and reach, not a builder meter. If you
own an API, start at [For API providers](/for-providers).
## What Cloud adds over the free engine
* Comprehend any OpenAPI → **first-call-correct** tools · auth hidden
* `$0` recorded mode · the MCP surface + one-click add — you host it
* Anti-poisoning defenses + agent-native artifacts
* Local eval + your own telemetry — **on your disk, we see nothing**
* No account. Telemetry ships **disabled**.
* **Hosted MCP** — always-on endpoint, nothing to run or scale
* **Drift-watch** — re-comprehend when your API changes, alert *before* your integrators break
* **Access analytics** — first-call-correct rate, dark ops, failed→settled
* **Team** — shared surfaces, roles, audit, deploy-to-your-domain
*Explored V2 direction (not delivered): a cross-API correctness signal drawn from
across the fleet.*
**Control-plane holds in the cloud.** We store the API **surface**, the generated
**tool definitions**, and **correctness metadata** — never your response payloads,
user data, or secrets. No lock-in: you can go back to fully self-hosted anytime.
## Plans — you pay when you scale
The tier is what scales — performance and reach, not the core capability (that's free).
The open-source engine + a free hosted tier to try — **shared throughput, best-effort
latency.** Point it at your API and see the agent-native surface today.
**Low latency, dedicated throughput, faster drift-watch, analytics, longer retention.**
For an API that's becoming load-bearing for agents.
**SLA, high throughput, white-label private discoverability, onboarding.** For an API
that's a real part of the agent economy.
We price the **value** — keeping your surface correct through drift and turning failed
agent calls into settled ones — **not the compute**, and **never a cut of what agents pay
you.** The model we're building toward is a **flat per-API subscription** that steps up
with performance/scale (Free → Pro → Scale), the Pro tier illustratively in the low
hundreds/month per API, deliberately below the coding-agent seat you already pay for.
Prices are **illustrative** — they land when Cloud ships. We're showing the shape now,
not locking a number.
## Payments — you keep 100%
We collect **our own flat fee** over whatever rail fits you — **x402 / USDC** (or **PayAI**
for recurring), or **card / fiat** via **Privy**, **abacatepay**, or Stripe. It's an injected,
neutral seam, so the rail is a config choice, not a rewrite.
And when it comes to *your* API getting paid by agents, we **compose** your rail — we point
the tools at your x402 endpoint (**PayAI, pay.sh, or a metering/billing rail**) as part of the setup. You keep
every cent; **Gecko is never the payment rail and never a marketplace.**
## How we make money, plainly
A flat monthly subscription per API we keep agent-correct and drift-watched — collected as
our own fee, **never a cut of what agents pay you.** The engine developers use is free and
open source. The moat is execution: comprehension + comprehension-native security + auth
handled day-one, combined — not a data corpus.
## Come build it with us
Cloud is being built alongside the API providers who feel it most. If agents keep calling
your API wrong — or you want it to be the one they call *right* — that's exactly the surface
we want to make agent-ready.
Join the Discord — we build in the open and figure out which API to make agent-ready next.
`npx @geckovision/gecko ` runs the whole engine on your machine today.
# Code assistants
Source: https://docs.geckovision.tech/code-assistants
Your code assistant writes the call it can read. The calls that cost you money are the ones nothing wrote down.
## Start here: often you don't need us
Your code assistant is good at this. Point it at an OpenAPI spec and it will write you a
working client, usually on the first try.
For one API, with you reading the diff, that is the right tool. Use it.
This page is about the second API. And the one that spends money.
## 1. It writes the call it can read
A code assistant works from what is written down. That is its whole method.
So it cannot know what is missing. And on the surfaces that matter, a lot is missing —
not because someone was careless, but because the fact does not belong in a document at
all.
| what the surface says | what the call needs |
| ---------------------------------------------------------------------------------- | ----------------------------------- |
| Jupiter's route surface declares **9 accounts** | the call needs **25** |
| Pump.fun's `bonding_curve_v2` appears in **one prose comment**, in no account list | required, or the buy reverts |
| Meteora's root address seed is **absent from the IDL** | every other account derives from it |
Those 16 extra Jupiter accounts are the legs of whichever route the aggregator picked a
second earlier. They are not in the specification and **cannot be** — they are not facts
about the program.
Given that surface, an assistant writes confident, well-formed, wrong code. Nothing in
its input tells it so.
## 2. Its debugging loop needs an error
Write, run, read the error, fix. That loop is exactly why a code assistant is good.
It has two limits.
On a paid API, every turn of the loop is billed. On a transaction that spends, the loop
does not exist — the first attempt is the real one.
And the failure that costs the most produces no error at all. The call is well-formed,
the API accepts it, nothing throws — the wrong pool, the wrong account, a charge posted.
The loop terminates **successfully**, on a wrong outcome.
## 3. It pays for the surface on every task
A 43-operation API is a lot of tokens. Reading it competes with the actual task, in the
same context window, every time.
Gecko hands over the one call instead. On a real production API that measured **79.3%
less context** (113,072 B of OpenAPI → 23,382 B of agent surface, 43 operations, measured
2026-08-06) — with first-call-correctness held, which is the only version of that number
worth quoting.
## 4. Its natural output puts your key in a file
Ask an assistant to wire up an API and you get a credential in `.env` or `mcp.json` —
inside the agent's context, in your shell history, in your repo if you blink.
Gecko injects credentials at call time. The agent describes intent. It never sees a key.
## The difference in one line
A code assistant gives you **integration code** — an artifact you now own and maintain,
correct on the day it was written.
Gecko gives your agent **the call** — derived fresh, every fact tagged with where it came
from, and for anything that spends, simulated to a receipt before it counts.
They are not competing. Most teams should have both.
Watch it route an intent, show what it rejected, and mark every account with its
origin — including the ones it flags instead of guessing.
What a simulation proves before you sign, and what it does not.
# How comprehension works
Source: https://docs.geckovision.tech/comprehension
Ingest, catalog, and the question-shaped tool generator — the path from an OpenAPI surface to first-call-correct agent tools, tied to the real engine.
Comprehension is the product. It is the path from a raw API surface to tools an agent
calls correctly the first time. Three stages, each a small focused module.
The same comprehension runs on-chain: [The Program Surface](/program-surface) recovers the
PDA seeds a Solana IDL drops and derives the accounts first-plan-correct.
## 1. Ingest the surface
Gecko parses an **OpenAPI 3.x** document (YAML or JSON) into a normalized list of
operations. It resolves local `$ref`s with **cycle and depth guards** — on a cycle or
when the depth cap is hit, the `$ref` is left in place rather than expanded, so callers
still get a usable (if shallow) schema. Path-level parameters are merged into each
operation's own parameters.
Each `Operation` carries: method, path, `operation_id`, summary, description, tags,
parameters, request body, responses, and security. Each `Param` carries: name,
location, required, schema, description.
Ingest reads the **surface only** — method, path, params, request/response schemas.
It never reads or stores response data. The ingestor is stdlib + PyYAML by design, so
it runs anywhere with zero heavy dependencies.
Ingested spec content is treated as **untrusted input**, and any URL fetched to load a
remote spec is validated first.
## 2. Catalog — intent to endpoint
The catalog lets an agent go from a natural-language goal to the right endpoint. It
scores each operation by lexical overlap between the query and the operation's surface
text — summary, description, path, tags, and id — with **summary matches weighted
double** (it's the most intent-bearing field). Results are ranked and returned.
```python theme={null}
catalog.search("get live odds for a fixture", limit=5)
# → ranked CatalogEntry list, highest score first
```
It can also group capabilities by tag and emit a human/agent-readable capability map.
This is **lexical, not vector** search, and that is a design choice rather than a
milestone: the graph never *approximately* remembers. BM25 and semantic tiers both sit
behind evidence gates that flip only on **measured** lexical recall failure — fed by a
misrank-aware evaluation (a golden set plus a closed miss-cause vocabulary). One measured
negative result on embeddings is already on record. See [find\_start](/find-start) for the
on-chain twin of this router and the honesty floor it enforces.
## 3. Comprehend — the question-shaped tool
Each operation becomes an MCP-compatible tool definition: a name, a **question-shaped
description**, and a JSON-Schema input. Two decisions make this more than a raw OpenAPI
dump:
**Hide the plumbing.** Auth headers (`Authorization`, `X-Api-Token`, and similar) are
stripped from the agent-facing input. The agent reasons only about decision-relevant
inputs; the [access layer](/access-and-auth) injects credentials at call time.
**Carry invocation metadata.** The tool keeps an internal `_invoke` block — method,
path, and the location of each parameter — so the caller can build the real HTTP
request without re-parsing the spec.
A generated tool looks like:
```json theme={null}
{
"name": "get_odds_snapshot_fixtureId",
"description": "Live odds snapshot for a fixture. Required: fixtureId.",
"inputSchema": {
"type": "object",
"properties": { "fixtureId": { "type": "integer" } },
"required": ["fixtureId"]
},
"requires_auth": true,
"auth_schemes": ["apiKeyAuth", "httpAuth"]
}
```
`requires_auth` is true only when *every* way to call the operation needs auth (an
OpenAPI `security` requirement of `{}` means "no-auth is also acceptable", which keeps
it optional). The client uses `requires_auth` + the session to **hide operations a
no-auth session could never satisfy**, so the agent never wastes a call on them.
## 4. Build the correct request
When the agent calls a tool, the caller places each argument by its location, injects
the hidden auth headers, and assembles the request. Crucially, it **catches the silent
first-call failure** — for example a missing required path parameter raises a typed
`CallError` instead of firing a malformed request the agent can't diagnose.
## Measuring first-call-correct
Gecko ships a falsifiable scorecard. Given a client and a list of
`{goal, expect_op, args}` tasks, it measures whether the comprehension layer retrieves
the right operation (top-1 / top-5) and builds a well-formed request for it — recorded
and offline, recording **only outcome metadata** (tool, rank, ok/reason), never
payloads.
```python theme={null}
from gecko.evaluate import evaluate_tasks
card = evaluate_tasks(client, tasks)
print(card["top1_rate"], card["top5_rate"], card["well_formed_rate"])
```
This is the same harness used to score a **second public API** end-to-end (see the
`scripts/pegana_eval.py` worked example in the repo, which ingests a public peg-state
API with a no-auth session and scores first-call-correctness, including correctly
**refusing** to fire an auth-gated operation on a public read). It's evidence the
engine is API-agnostic, not a claim that Gecko one-shots every API.
# Concepts
Source: https://docs.geckovision.tech/concepts
The vocabulary — surface, graph, provenance, receipt, drift, question-shaped tool, session, and the two run modes.
A small, precise vocabulary runs through the whole system. Learn these and the rest of
the docs read cleanly.
## Surface
The *surface* of an API is everything that describes how to call it: methods, paths,
parameters, request/response **schemas**, auth schemes. It is **not** the data the API
returns. Gecko ingests the surface and nothing more — this is the basis of the
[control-plane](/architecture) promise.
A **Program Surface** is the on-chain analog — a Solana program's instruction↔PDA graph
with the seeds an IDL drops recovered. See [The Program Surface](/program-surface).
Every surface is treated as **untrusted input**, whether it came from a provider's spec,
a docs page, an IDL, or program source.
## Graph
A surface tells you what exists. A **graph** tells you what depends on what — which call
must happen before which, which account must be derived before another can be, which
field from one response keys a call to a different API.
Gecko's graphs are what the agent **traverses instead of guessing**. Two of them:
* The **surface graph** — operations, their relationships, and cross-API joins.
* The **program graph** — instructions, accounts, and the dependency-ordered derivation
those accounts require.
## Provenance
The tag on every edge and every account, from a **closed** vocabulary. Never a free-text
justification, never a fabrication.
| On-chain | Meaning |
| ----------- | ------------------------------------------------------------------------------ |
| `EXTRACTED` | read directly off the surface |
| `RECOVERED` | not on any public surface — reconstructed from source, or resolved empirically |
| `FLAGGED` | unknown. Named explicitly and never dropped. |
| HTTP | Meaning |
| ---------------------------------- | ------------------------------------------------ |
| `EXTRACTED` | in the spec |
| `DECLARED` | stated by the provider (e.g. a vendor extension) |
| `INFERRED` | derived by Gecko from structure |
| `CLAIMED` → `VERIFIED` / `REFUTED` | asserted in prose, then checked against reality |
Provenance is the honesty mechanism. If Gecko doesn't know, it says `FLAGGED` — it does
not fill the hole.
## Overlay
The measured artifact of comprehension: for an auto-comprehended program, the explicit
list of facts that could **not** be derived from any public surface. It quantifies the
gap between "what the IDL says" and "what it takes to act" — per program.
## Receipt
The output of simulating a built transaction on a \$0 mainnet fork, *before money moves*:
`status` (pass/fail), a **categorical** `revert_class`, `units_consumed`, best-effort
deltas, and an honest `network_label`. A fork Receipt is never presented as mainnet
truth, and a Receipt never predicts price. See [The Receipt](/receipt).
## Corpus and drift
The **corpus** is Gecko's episodic memory: categorical call outcomes from closed
vocabularies (`observed` / `reported` / `synthetic` / `simulated` tiers) — status class,
revert family, compute units, a values-free recipe hash. **Never** a payload, a pubkey,
an amount, or a log line. Recording is an explicit opt-in; the default is record nothing.
**Drift** is the N-confirmed signal derived from it: "clean at slot S, reverts at S′."
It is how you learn a provider broke you without waiting for a production incident.
Read it back with `gecko drift `. See [Stay correct](/stay-correct).
## Operation
A single callable endpoint, normalized from the spec into a typed record: method, path,
`operation_id`, summary/description, tags, parameters, request body, responses, and
security. Local `$ref`s are resolved (with cycle and depth guards) so each operation is
self-contained.
## Parameter
A normalized input to an operation, carrying its `name`, `location`
(`path` / `query` / `header` / `cookie`), whether it's `required`, and its schema. The
location is what lets the caller place each agent-supplied value in the right spot.
## Catalog
The "find the right starting point" layer — lexical, token-overlap scoring over each
operation's surface text, summary weighted highest. **No vectors:** the graph never
*approximately* remembers, and BM25 and semantic tiers sit behind evidence gates that
flip only on measured recall failure. On-chain, the same engine powers
[`find_start`](/find-start).
## Question-shaped tool
The comprehension payload: an operation rendered as an agent-reasonable tool definition —
a name, a question-shaped description, and a JSON-Schema input. Two decisions separate it
from a raw OpenAPI dump:
* **Auth is hidden.** Authorization-style headers are removed from the agent-facing
input. The agent only sees decision-relevant inputs.
* **Invocation metadata travels with the tool.** The method, path, and per-parameter
locations ride along so the caller can build a real request without re-parsing the
spec.
Each tool also carries `requires_auth` and the `auth_schemes` it references, so a session
with no credentials can hide operations it could never satisfy.
## Plan
Procedural memory as **typed, executable JSON** — a `landing_plan`, a
`derivation_order` — not prose an LLM has to re-read and re-interpret. A builder can run
a plan directly. Text loses the join; typed data can't.
## Session
The access/auth seam. Any object with `auth_headers() -> dict[str, str]` is a valid
session. A paywalled API returns its tokens; a public API returns an empty dict. The
agent never sees these headers — Gecko injects them at call time from your OS keychain.
See [Access & auth](/access-and-auth).
## Caller
Turns a question-shaped tool plus the agent's arguments into a correct HTTP request: it
places each value in the right location (path / query / header), injects the hidden auth
headers, and **catches the failure the agent can't see** — like a missing required path
parameter — instead of firing a malformed call.
## Modes: recorded vs live
Gecko runs one code path in two modes:
| Mode | Network | Cost | What you get |
| ---------- | ------- | ----------- | ------------------------------------------------------------------- |
| `recorded` | none | \$0 | response synthesized from the response schema — falsifiable offline |
| `live` | yes | per the API | the real upstream response |
They differ **only at the transport edge**. Recorded is the default; live requires a
credential you set explicitly. See [Recorded mode](/recorded-mode).
## First-call-correct
The bar Gecko holds itself to: given a natural-language goal, retrieve the right
operation and build a **well-formed** request for it on the first try — no trial calls,
no malformed requests the agent can't diagnose. A built-in evaluation scores retrieval
(top-1 / top-5) and request well-formedness against a task set, and `gecko test `
turns that into a suite you can fail a build on.
First-call-correctness is a **proof point**, not the headline. The headline is the graph:
provenance you can audit, and a receipt before money moves.
# Agent discoverability
Source: https://docs.geckovision.tech/discoverability
Gecko exists to make an API discoverable to agents. Question-shaped tools, intent-to-endpoint search, hidden auth, and an llms.txt for the API itself.
Discoverability is how comprehension pays off for agents. Once Gecko has comprehended
an API, agents need to find and install that surface. A human can read
docs, infer the right call, and guess at parameters. An agent shouldn't have to. These
are the mechanisms that make an ingested API discoverable. An API surface, or a Solana
[Program Surface](/program-surface), can be made discoverable the same way.
## Intent, not endpoints
An agent describes *what it wants*, not which path to hit. The catalog turns that
intent into a ranked list of candidate operations, and the `search_capabilities` tool
on the [MCP surface](/mcp-surface) exposes it directly:
```python theme={null}
client.search("what fixtures are coming up?")
# → [{ "name": ..., "summary": ..., "path": ..., "method": ... }, ...]
```
## Question-shaped descriptions
Every tool's description is written as the question it answers, with required and
optional inputs called out. The agent picks the right tool from the description alone,
no API docs in front of it. See [How comprehension works](/comprehension).
## Auth is out of the way
Auth headers never appear in the agent-facing tool input, and operations the current
session can't authenticate are hidden entirely. The agent's surface is exactly the set
of calls it can actually make, nothing it would only fail at. See
[Access & auth](/access-and-auth).
## Only the calls that will work
When a [session](/access-and-auth) can't satisfy an operation's auth, that operation is
removed from `list_tools()` and `search()`. Discoverability means surfacing the *usable*
surface, not the whole spec. An agent should never discover a call it can't complete.
## An llms.txt for the API
Gecko can emit an agent/human-readable capability map grouped by tag, the
machine-facing equivalent of a table of contents for the API:
```python theme={null}
print(client.catalog.describe())
# ## fixtures
# - GET /api/fixtures/snapshot — upcoming fixtures
# ## odds
# - GET /api/odds/snapshot/{fixtureId} — live odds for a fixture
```
This docs site itself ships an [`llms.txt`](/llms.txt), a discoverability map for
these docs, in the same spirit. If you're an agent, start there.
## The agent-native layer, and we dogfood it
Docs are a human handoff. An `llms.txt` or an MDX page is something an agent has to
*read and trust*; the agent-native contract is a **structured tool it calls**. Gecko's
job is to turn the human-shaped surface into that tool, so an agent finds and uses the
right call without reading prose.
Gecko projects one comprehended surface three ways, for three moments:
* **`llms.txt`**: a breadcrumb for an agent that lands on the docs: the capability map
plus a pointer to the live MCP and `search_capabilities`. (These docs ship one;
[read it](/llms.txt).)
* **OpenAPI + `x-gecko`**: the spec an OpenAPI-native tool already ingests, enriched in
place with question-shaped intents, prerequisites, and worked examples. Unknown `x-`
keys degrade gracefully, so a non-Gecko consumer just ignores them.
* **`/.well-known/gecko.json`**: the machine-precise manifest `search_capabilities`
navigates: the capability graph (which call produces the id another call needs), worked
examples, and first-call-correct stats.
All three cross-link, so an agent landing on any one reaches the callable tool. This docs
site is the reference implementation: our own surface is exposed through the same layer
we generate for any API.
## Everything an agent can fetch
This docs site publishes the same agent-native surface Gecko generates for any API.
Point your agent at any of these:
* [`llms.txt`](https://docs.geckovision.tech/llms.txt): the curated index of these docs
* [`llms-full.txt`](https://docs.geckovision.tech/llms-full.txt): the whole docs as one Markdown file
* [`gecko.json`](https://docs.geckovision.tech/gecko.json): the machine-readable manifest for this site
* [`/.well-known/gecko.json`](https://docs.geckovision.tech/.well-known/gecko.json): the manifest at the discovery-convention path
* **Any page on this docs site as Markdown**: append `.md` to its URL (e.g. [`/discoverability.md`](https://docs.geckovision.tech/discoverability.md))
* [Agent runbook](https://www.geckovision.tech/agents.md) and [client wiring](https://www.geckovision.tech/mcp-config.json): the canonical setup on the landing site
* [Flagship MCP surface](https://mcp.geckovision.tech/orquestra/mcp): Streamable HTTP, 16 tools, no key
* [Served surfaces](https://mcp.geckovision.tech/.well-known/gecko.json): the ten mounted surfaces, each described at [`catalog.md`](https://www.geckovision.tech/catalog.md). The host root, [`/mcp`](https://mcp.geckovision.tech/mcp), serves two tools: `comprehend_api` and `list_surfaces`
* [Product manifest (canonical)](https://geckovision.tech/gecko.json): the source-of-truth manifest on the landing
Shipped today: the MCP surface, `search_capabilities`, hidden auth, a usable-only
surface, and this site's own agent-native artifacts: `llms.txt`, `gecko.json`, and
`/.well-known/gecko.json` (discovery level). Rolling out (see [Roadmap](/roadmap)): the
`x-gecko` OpenAPI enrichment and the richer `/.well-known/gecko.json` **capability graph**
(which call produces the id another call needs), `search_capabilities` returning the full
call recipe inline (prerequisites + a worked example), and access-quality measurement:
did the agent find and correctly use the call. We build these against our own docs first.
## Scope
Discoverability is live today on an ingested **OpenAPI 3.x** surface. Gecko makes a
*known* API surface agent-usable. It doesn't crawl arbitrary human-only docs, auto-discover
APIs across the internet, or verify the data an API returns. See [Status](/status).
# find_start, intent to starting point
Source: https://docs.geckovision.tech/find-start
The hardest part is not making the call. It is knowing where to start. find_start routes a plain intent to the right (program, instruction) with a provenance-tagged derive plan, and says "no start found" rather than guessing.
The hardest thing for an agent acting against an unfamiliar surface is not making the
call. It is knowing **where to start** among N programs × dozens of instructions, or N
endpoints across a 600-operation spec.
Gecko has two routers for that, one engine underneath.
| Router | Question it answers | Surface |
| --------------------- | ------------------------------------------------------------------------- | ------------------------- |
| `search_capabilities` | "which endpoint fits this intent?" | any comprehended HTTP API |
| `find_start` | "which (program, instruction) do I start at, and what do I derive first?" | on-chain program surfaces |
Both score lexically, by token overlap between the intent and the surface text. **No
vectors.** At this scale lexical retrieval is more accurate and fully deterministic: the
graph never *approximately* remembers. BM25 and semantic tiers sit behind evidence gates
that flip only on measured recall failure, fed by a misrank-aware evaluation (a golden
set plus a closed miss-cause vocabulary). Misses are instrumented **categorically**,
never the intent text.
## The API catalog
```python theme={null}
catalog.search("get live odds for a fixture", limit=5)
# → ranked CatalogEntry list, highest score first
```
Over MCP the same thing is a synthetic tool your agent calls first:
```json theme={null}
{
"name": "search_capabilities",
"description": "Find which endpoint/tool fits a natural-language intent. Returns ranked tool names you can then call.",
"inputSchema": {
"type": "object",
"properties": { "query": { "type": "string" } },
"required": ["query"]
}
}
```
Operations the current [session](/access-and-auth) could never satisfy are not listed at
all, so the agent never burns a call on them. See [The MCP surface](/mcp-surface).
## find\_start, on-chain
```bash theme={null}
gecko orquestra find-start "buy token X on pump"
```
Exit code `0` means a start was found; `1` is an honest no-start. The same tool is served
hosted at `mcp.geckovision.tech/orquestra/mcp`.
It returns, per ranked candidate:
* **The start point**: `program/instruction`, its `program_id`, the score, and which
tokens matched.
* **A dependency-ordered derive plan**: every account in the order you must derive it,
each carrying a **provenance tag**.
* **Declared preludes**: the instructions that must ride along for the transaction to
land (idempotent ATA creation with the Token-2022 resolution note, compute budget).
* **Flagged gaps**: facts Gecko will not guess, named explicitly so you resolve them
before building.
* **An execute pointer**: the external builder's URL. Orquestra builds; Gecko never
signs.
The shape of the output (scores and the full account list vary per intent and per
program; run it to see yours):
```text theme={null}
START 1. pumpfun/plan_buy — score (matched: buy, pump, token)
program_id: 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
next tool: plan_buy
derive plan (dependency-ordered):
1. global [extracted]
2. bonding_curve [extracted]
3. associated_bonding_curve [extracted]
4. associated_user [extracted]
5. creator_vault [recovered]
6. bonding_curve_v2 [recovered]
preludes (DECLARED):
- create_idempotent_ata: … removes the AnchorError 3012 revert …
- compute_budget: SetComputeUnitLimit + SetComputeUnitPrice …
flagged gaps (honest — resolve before building):
! fee_recipient: …
execute: POST https://…/build (Orquestra builds; Gecko never signs or broadcasts)
```
## Provenance is the point
Every account in the plan carries one of three closed tags:
| Tag | Meaning |
| ----------- | ---------------------------------------------------------------------------------------- |
| `extracted` | read directly off the surface (the IDL, the spec) |
| `recovered` | **not on any public surface**: reconstructed from program source or resolved empirically |
| `FLAGGED` | Gecko does not know it, and says so. Never dropped, never invented. |
`recovered` is where the value is. `bonding_curve_v2` is required by Pump.fun's `buy`
and never appears in the IDL. Meteora's `base_factor` seed was added by the SDK in 2024
and the deprecated three-seed scheme derives **the wrong pool, silently**. A tool that
only reads the IDL cannot know either.
On the HTTP side the vocabulary is richer, because docs make claims:
`EXTRACTED` > `DECLARED` > `INFERRED` > `CLAIMED` → `VERIFIED` / `REFUTED`. A claim
recovered from a docs page stays `CLAIMED` until a probe verifies or refutes it. See
[From docs](/from-docs).
## The honesty floor
Below the retrieval floor `find_start` returns **`NO START FOUND`** and labels the
closest candidates as `GUESS`, never dressed up as starts. A nonsense intent cannot
clear the floor on stopword overlap alone.
This is the same rule as the rest of the system: an unknown is `FLAGGED`, not
fabricated.
## Not built yet
Catalog **breadth** is the open frontier: 4,500 projects are listed, and seven program
configs ship (Pump.fun, Meteora, Jupiter, ORE, MetaDAO, Orca Whirlpool, let\_me\_buy).
For an unwired project, `find_start` returns it as a **catalog candidate** with the
comprehend-first command rather than pretending it has a plan. See [Status](/status).
What a program surface is, and the mainnet programs it's proven on.
Once you have the plan: simulate it to a receipt before anything is signed.
# For API providers
Source: https://docs.geckovision.tech/for-providers
Agents are becoming a consumer of your API — and they fail it silently. Make yours the API agents find, call correctly on the first try, and keep calling as you ship.
## The problem you can't see from your side
Your docs are written for humans — and they work for humans. But a growing share of your
integrations are now attempted by **AI agents**, and for them the experience is different:
* **Agents mis-call you.** Wrong parameter, wrong endpoint, an auth scheme inferred
incorrectly from prose. On your side that's malformed requests, retry storms,
rate-limit pressure, and support tickets that read "your API doesn't work" — when
really, the agent guessed wrong.
* **Agents can't find you.** An agent picks the API it can *discover and call correctly
today*. If that's your competitor, the traffic — and the integration — goes there. You
never see the loss; it just never arrives.
* **Your own changes break your integrators.** A renamed field that no human would
miss silently breaks every downstream agent. Their 2am incident becomes your support
ticket and, eventually, your churn.
* **A hand-rolled MCP server goes stale.** Teams that ship their own agent surface cover
a handful of endpoints, then drift out of date the next time the API ships.
None of this shows up in your analytics, because failed and never-attempted agent calls
are invisible by definition. That's the trap: the pain is real, and it's unmeasured.
## What Gecko does about it
Gecko is **where agents and APIs finally speak the same language**. Point it at your OpenAPI (or your
docs — [no spec needed](/from-docs)) and your **whole surface** becomes question-shaped,
first-call-correct agent tools: auth handled invisibly, operations an agent can't
satisfy hidden, everything provable offline first.
## Bringing your API onboard — five moves
Some moves are self-serve and free today; one is a deliberate manual handshake (we don't
want your credentials flowing through a form); a couple are still hands-on while we build
them toward self-serve. Each is labeled with what's real right now.
Before anything else, see where you stand. `gecko inspect ` grades your API
across four dimensions — **first-call-correct**, **spec hygiene**, **agent-friendliness**
(ambiguous routing traps a schema linter can't see), and **security** — and prints
located, fixable findings. Integrate it into CI (`--min-grade B`) to fail a deploy that
regresses. It's TDD for your API.
```bash theme={null}
npx @geckovision/gecko inspect # or a bare domain / docs URL
```
Paste your OpenAPI URL — or [your docs](/from-docs), no spec needed — and get
question-shaped, first-call-correct tools back, provable offline before a single live
call. Run it yourself: `npx @geckovision/gecko `. You
see your own API comprehended in one session, no account, no cost.
Most real APIs are auth-gated, so this is the step that needs a human exchange: hand
us a **sandbox key** and agree the **safe scope** — which operations agents may call;
anything that moves money is excluded or step-up-gated, not handed to an arbitrary
agent. Gecko stores the credential as an *opaque reference* and injects it at call
time — the agent never sees a token. See [Access & auth](/access-and-auth).
Your comprehended surface is hosted at `/{you}/mcp` with the agent-native breadcrumbs
— `llms.txt`, `gecko.json`, `/.well-known/gecko.json`, `/.well-known/x402.json` — so
agents *discover* you, not just call you ([Agent discoverability](/discoverability)).
Your own MCP, if you have one, keeps running untouched; Gecko sits **beside** it. You
get one line to hand your developers: `claude mcp add --transport http you https://mcp.geckovision.tech/you/mcp`.
Charge agents per call by pointing the generated tools at **your own** x402 endpoint
(PayAI or pay.sh). The 402 challenge, the funds, and the settlement are
yours; Gecko composes the rail, holds nothing, signs nothing, and **takes no cut.**
You see the full challenge→settle handshake offline first (`X402_MODE=stub`) before
any real money moves; on-chain settlement is proven on devnet, and any mainnet
transaction is run by you, never by us.
Drift-watch re-comprehends your API when you ship and regenerates the tools, so your
next release doesn't silently break downstream agents — the alert fires **before their
prod does.** The surface fingerprint that makes this tractable exists today; the
auto-update loop and the adoption dashboard are **designed for V2, not yet shipped**
([Stay correct](/stay-correct)).
## What we need from you
To take a real API from comprehended to a live, measured surface:
* **A sandbox / test API key** (+ the sandbox base URL) — unlocks the gated operations
and keeps calls off production.
* **Your current OpenAPI spec** (or confirmation the docs URL is current) — so the
surface reflects today's API, and drift is measured against a real baseline.
* **The safe scope** — which operations agents may call; what to exclude or
step-up-gate (anything that moves money).
* **Distribution** — put the add-command in front of your developers. Gecko *measures*
the funnel (who connected, called, came back); it doesn't *create* the traffic.
That's the whole ask. **No production credentials, no build work on your side, no money
changing hands to start, no exclusivity.**
## Who pays, in one sentence
> **The engine is free forever for builders; API providers pay a flat per-API
> subscription for hosted, drift-watched, agent-ready surfaces.**
Flat fee. Never a percentage of your revenue, never a cut of what agents pay you, never
a public catalog listing you didn't ask for. Illustrative shape on the
[Cloud page](/cloud) — prices land when Cloud ships.
## Why this is measurable (unlike docs spend)
Human-docs spend is famously unattributable. Agent comprehension isn't: a
first-call-correct fix turns a **failed** call into a **completed** one — and if your
API is x402-metered, into a **settled** one. The delta is visible per API revision.
That's the difference between a cost center and an ROI line.
## What's live
The comprehension engine, the scorecard, discoverability artifacts, and the free
self-serve flow are **live today**. Drift-watch, access analytics, and the hosted
provider plane are **building now** — with the first design partners. See
[Status](/status) and [Roadmap](/roadmap) for the exact line.
## Bring your API
`npx @geckovision/gecko inspect ` — your agent-readiness grade + fixable
findings in one session. Self-serve, offline, \$0, no account.
Run the open-source engine against your own spec today — comprehend, serve over
MCP, emit your agent-native surface.
# From docs
Source: https://docs.geckovision.tech/from-docs
No OpenAPI? Point `gecko from-docs` at an API's doc site and it recovers a draft OpenAPI, then comprehends it into agent tools — with honest review notes for anything it couldn't pin down.
Plenty of good APIs never publish an OpenAPI file. The docs are fine; the machine-readable
artifact just doesn't exist, so there is nothing for a tool generator to read.
`gecko from-docs` is the on-ramp: it reads the doc site and hands the comprehension engine
a *draft* OpenAPI.
```bash theme={null}
gecko from-docs https://docs.some-api.com
gecko from-docs ./api-docs.html # a local file, for dev
gecko from-docs -o draft.json # also write the draft spec
```
## What it does
1. **Fetch** the doc page — SSRF-validated (private / loopback / link-local ranges and
non-HTTP schemes are refused, every redirect re-checked). The bytes are parsed and
**discarded**: Gecko is control-plane only, it never stores the doc.
2. **Recover** candidate operations from the page's structure — headings, code blocks, and
parameter tables, in document order — into a draft OpenAPI 3.1. JSON-RPC methods are
modeled honestly (one operation per method; the envelope carried on `x-jsonrpc-*`).
3. **Comprehend** the draft through the *same* engine as any spec → question-shaped,
first-call-correct agent tools.
```text theme={null}
Gecko from-docs — recover a draft API from human docs
========================================================
source: https://docs.some-api.com
recovered 3 candidate operation(s):
- sendBundle [POST /api/v1/bundles] (jsonrpc, high)
- getTipAccounts [POST /api/v1/bundles] (jsonrpc, high)
- getTipFloor [GET /api/v1/bundles/tip_floor] (rest, medium)
honesty: 2 x-review note(s), 2 low/medium-confidence field(s) to confirm.
optional auth recovered: x-tip-auth header (injected by the access layer, invisible to the agent).
comprehended draft -> 3 agent tools.
```
## It's an assistive draft, not zero-touch
`from-docs` is honest about its uncertainty. Every field it couldn't pin down from the docs
is flagged with `x-review` and a confidence level in the draft spec — so a human (or an
agent) confirms those before going live. It gets the **surface and shape** right; you confirm
the ambiguous edges, then run [`gecko test `](/quickstart) to prove the calls before
you ship.
## JS-heavy doc sites
Static docs work out of the box with the built-in reader — no extra dependencies. For doc
sites that render their navigation with JavaScript, `from-docs` tells you when it recovered
only a few operations and points you at the agent-browser driver in
[`spikes/docs_reader`](https://github.com/GeckoVision/gecko-surf/tree/main/spikes/docs_reader),
which renders the JS nav before extracting.
## Why this matters
Every other page here starts from a spec. This is the step before that. An API with no
OpenAPI file isn't a worse API — it just has nothing an agent can read mechanically.
`from-docs` produces that artifact, marks what it could not pin down, and never invents
an endpoint to fill a gap. From there the rest of the pipeline is identical.
# Gecko 101
Source: https://docs.geckovision.tech/gecko-101
Your agent tries the call before it makes it. One URL, no install, no key, and a receipt before anything is signed.
## The problem
Your agent's first call is the real one. There is no rehearsal.
A wrong call that errors is the cheap failure. You find out.
The expensive one is quiet. Well-formed, accepted, nothing throws, and the world is now
wrong. Nobody gets an alert for a call that worked and was wrong.
## Watch it run
Ten questions, four programs, one landed transaction. Every command real, one take.
## What Gecko is
Gecko reads an API (its spec, its docs, or for a Solana program its IDL and source) and
turns it into tools your agent calls correctly the first time, every fact tagged with
where it came from.
For anything that costs money, it runs the call somewhere that doesn't count first and
hands back a **receipt** with a binding to the exact bytes. Then someone else signs.
Gecko is not the agent. It holds no key and signs nothing. The only thing it sends to a
chain is signed bytes that verify against a binding it issued.
## Your first call
No install, no account, no key, no spend. The flagship surface covers Solana storefronts,
Orca Whirlpool swaps, `find_start` and program graphs:
```bash theme={null}
claude mcp add --transport http gecko https://mcp.geckovision.tech/orquestra/mcp
```
Every other client's wiring is in
[`mcp-config.json`](https://www.geckovision.tech/mcp-config.json), and the executable
runbook is [`agents.md`](https://www.geckovision.tech/agents.md). Or let a skill do it:
```bash theme={null}
npx skills add GeckoVision/gecko-surf # gecko-setup + six more
```
For a keyless HTTP API, same shape:
```bash theme={null}
claude mcp add --transport http pegana https://mcp.geckovision.tech/pegana/mcp
```
Ask, in plain words:
```
Is USDC still pegged right now?
```
```
USDC PEGGED $0.9998 confidence: high
```
Live answer, real production API. Your agent picked the right tool out of 28 and filled
the parameter, first try.
**Another client?** Put the same URL in your `mcp.json` under `mcpServers`. If it only
speaks SSE, use `/pegana/sse`: same tools, older transport.
The host serves ten surfaces. They are listed at
[`/.well-known/gecko.json`](https://mcp.geckovision.tech/.well-known/gecko.json) and
described at [`catalog.md`](https://www.geckovision.tech/catalog.md). The host root,
`/mcp`, serves two tools: `comprehend_api` (point it at your own API) and
`list_surfaces`.
## "I already have an OpenAPI spec and an MCP server"
Good. Keep both. Gecko reads the spec and speaks MCP.
**A specification tells you what a call looks like. It cannot tell you whether it will
work.** That is structural, and just as true of a perfect spec as a bad one.
| a spec cannot tell you | what that costs |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| **that the endpoint still answers** | a documented endpoint we were served returns 404. It was never real. |
| **facts that aren't about your API** | Jupiter's route surface declares 9 accounts. The call carries 25. The other 16 belong to a route chosen a second ago. |
| **a join to a spec it never heard of** | "is it pegged, and what can I exit at" spans three APIs. None declares the mint that connects them. |
| **how to be an interface** | 113,072 bytes of surface competing with your task, every turn. Gecko projects 23,382: 79.3% less, correctness held. |
| **a dry run** | neither a spec nor an MCP server has one. |
| **when it stopped being true** | a spec is a snapshot with no expiry. |
And one thing an MCP server *does*: it leaves your key in `mcp.json` or `.env`, inside the
agent's context. Gecko keeps it in your OS keychain and injects it at call time. The model
never sees it.
## The model underneath
Read the surface. Tag every fact `extracted`, `recovered`, or `flagged` as genuinely
unknown. Never invented. Below the retrieval floor it says "no start found" instead
of guessing.
Turn an intent into one specific call, including the accounts the surface does not
carry. Solana programs derive addresses from seeds; those recipes are often missing
from the IDL, and a guess gives you a valid-looking address for the wrong thing.
Run it against real chain state. \$0, unsigned, nothing broadcast.
Does it land, what does it cost, and if not, which class of failure. Plus a binding
over the exact bytes. See [The Receipt](/receipt).
Gecko hands back the plan, the receipt and the unsigned bytes. A wallet signs.
`verify_signed_transaction` proves the signed bytes are the checked ones, and
`submit_transaction` relays them only after that check passes. Different jobs, and
we do exactly ours.
## The proof
The engine repo's ledger (`docs/mainnet-ledger.jsonl`) holds 50 landed mainnet
transactions as of 2026-09-01. Every row that records both a prediction and a charge
matches to the compute unit. The latest three were prepared by the hosted MCP and signed
headless by a hosted signer against an exact binding.
They are public and linked on [A real transaction](/mainnet). Open any of them.
## What is not built yet
* **A receipt is true for the state it was taken against, and the binding dies with its
blockhash** (about 60 seconds). Prepare when you sign. Re-running is free.
* **Nothing re-checks on a schedule.** Drift is detected across runs you make.
* **Seven program configs ship** (Pump.fun, Meteora, Jupiter, ORE, MetaDAO, Orca
Whirlpool, let\_me\_buy). The catalog lists thousands. Different numbers.
* **Receipts are hosted on one surface.** The orquestra surface simulates against a
public mainnet RPC and returns a receipt with a binding. The other hosted surfaces give
tools, not receipts. A fork is your own node.
* **Gecko does not check whether an answer is true**, only that the call is right, and
on-chain, that the transaction lands.
## One next step
```bash theme={null}
npx @geckovision/gecko@latest prove "buy a token on pump.fun"
```
The whole candidate field, not just the winner, including the accounts it flags
instead of guessing.
```bash theme={null}
npx @geckovision/gecko@latest add https://your-api.com/openapi.json
```
No OpenAPI? Give it the docs URL. Then [Quickstart](/quickstart).
`prove` routes and shows provenance with no setup. A **receipt** additionally needs an
RPC: pass `--rpc-url`, or see [The Receipt](/receipt).
# Introduction
Source: https://docs.geckovision.tech/introduction
Your agent's first try is the real one. Gecko puts a rehearsal in between. It runs the call somewhere that doesn't count, shows you what will happen, and only then lets it count.
**Today, an agent's first attempt at your API is already the real one.**
And when it goes wrong it usually goes wrong quietly: the call is well-formed, the API
accepts it, nothing errors, and the world is now wrong.
**Gecko puts a rehearsal in between.** It works out which call to make, fills in what the
documentation cannot carry, runs it somewhere that doesn't count, and hands back a
**receipt** of what will happen. Then, and only then, it counts.
On 2026-08-06 an agent bought a bottle of water for 10 cents on Solana mainnet. **Before
paying, Gecko said exactly what the transaction would do, and that is exactly what
happened.** The engine repo's ledger (`docs/mainnet-ledger.jsonl`) now holds 50 landed
mainnet transactions (2026-09-01), across two storefronts, an Orca Whirlpool pool and
several account states. Every row that records both a prediction and a charge matches to
the compute unit. The latest three were prepared by the hosted MCP and signed headless by
a hosted signer, with no key on the machine that planned them. [See the
signatures](/mainnet); they are public, so you can check rather than trust us.
*For the technically minded: each receipt predicted the exact compute units the chain
then charged (36,508, then 36,399, then 22,527 for a different store), matching to the
unit, because the simulation runs the identical execution against the state it will land
on, not an approximation of it.*
```bash theme={null}
npx @geckovision/gecko prove "" # the rehearsal: which call, and will it work
npx @geckovision/gecko add # comprehend any API, $0, no live call
npx @geckovision/gecko watch # keep it true: re-run it as CI
npx @geckovision/gecko serve # your agent uses it over MCP
```
No install at all? Wire the hosted surface: the runbook is
[`agents.md`](https://www.geckovision.tech/agents.md), every client's config is
[`mcp-config.json`](https://www.geckovision.tech/mcp-config.json), and
`npx skills add GeckoVision/gecko-surf` installs the seven skills, `gecko-setup` first.
The brand is **Gecko**. The CLI is **`gecko`**. Install it with
`npm install -g @geckovision/gecko` (prebuilt binary, no Python) or from PyPI as
**`gecko-surf`** (`pip install gecko-surf` / `uv tool install gecko-surf`). The import is
**`gecko`** (`from gecko import …`).
## Why a description isn't enough
A specification tells you what a call **looks like**. It cannot tell you whether it will
**work**. That is structural, not a quality defect. It is just as true of a perfect spec:
* **Nothing in a spec runs.** `/v1/assets/{symbol}/state` is schema-correct with
`symbol` = `"string"`. Live, that call is a 404. Only running it tells you.
* **Some facts can't be in a spec.** Jupiter's route surface declares **9 accounts**; the
instruction that lands carries **25**. The other 16 are legs of a route computed a
second ago, facts about a different surface.
* **A spec can't declare a join to a spec it's never heard of.** The mint that connects
three Solana APIs is named differently in each and declared by none.
* **A spec is a snapshot.** Nothing in it says when it stopped being true.
Gecko replaces the guess with a rehearsal. The full answer to *"I already have an OpenAPI
spec and an MCP server"*, with the measured numbers, is in
[Gecko 101](/gecko-101#what-a-specification-cannot-tell-you).
Every fact is tagged `extracted` from the surface, `recovered` from source, or
honestly `flagged` as unknown. Never fabricated. Below the retrieval floor, Gecko
says "no start found" instead of inventing one.
An action is simulated first, producing a **Receipt**: pass, or a categorical
revert class, plus a binding over the exact bytes, before any spend. See
[The Receipt](/receipt).
Outcomes land in a categorical corpus; an N-confirmed drift series flags when a
provider ships a change that breaks a working call. See [Stay correct](/stay-correct).
Keys are injected at call time from your OS keychain. The model never sees a
credential, and no key goes in `mcp.json`. See [Access & auth](/access-and-auth).
## Who this is for
Not "teams with bad APIs." The gap above is in every spec. What changes is what a wrong
call costs you:
* **The call spends or commits something.** There is no retry loop when the first attempt
is the real one.
* **The agent runs unattended.** Nobody reads the diff before it happens.
* **You are on your Nth surface.** The cost is per-API and it compounds.
One API, and a human reviewing every diff? The value is real but it is smaller than the
cost of adopting anything, a one-week job either way. That is an honest no. Gecko earns
its place where a wrong call costs something.
## Proof, not promises
Live, on a **surfpool mainnet fork** (a mainnet-backed state snapshot, **not mainnet**),
simulation only, \$0, nothing signed or broadcast:
| Case | Naive path | Gecko |
| ----------------------- | ------------------------------------------------------ | ------------------------------------------------------------ |
| Pump.fun buy | ❌ reverts, `AccountNotInitialized (3012)` | ✅ lands, 86,669 CU |
| Meteora DLMM swap | ❌ reverts, derive-only, no ATA/wrap/bin-array preludes | ✅ wrap → swap → unwrap, 81,964 CU |
| Meteora pool derivation | ❌ stale 3-seed scheme → the wrong pool, silently | ✅ correct 4-seed derivation, differential-proven |
| Docs-only API (no spec) | agent invents endpoints | ✅ draft spec recovered, claims marked `VERIFIED` / `REFUTED` |
The facts behind those passes are not on any surface: a 4th PDA seed the SDK added in
2024, an account the IDL only mentions in prose, a fee field resolved by a refuting
simulation. That is the graph your agent traverses.
Compute-unit numbers are **measured per run** against a fork snapshot and vary slightly
with on-chain state. The stable claim is the side-by-side verdict: the naive path's
revert class vs Gecko's pass. The `base_factor` row is a **derivation** result. It has
no CU number and is never paired with one.
## Where Gecko sits
Gecko is **not the agent** and **not an orchestrator**. It is the memory-and-context
substrate *under* other people's agents: it comprehends external surfaces, projects them
as first-call-correct tools over MCP, verifies actions by simulation before execution,
and **never signs, never holds a key, never stores payloads**. The one thing it sends to
a chain is signed bytes that verify against a binding it issued.
There are three distinct jobs in the agentic economy. Gecko does exactly one.
| Layer | What it does |
| -------------------------- | ---------------------------------------------- |
| APIs get **PAID** | billing / settlement rail |
| skills get **DISTRIBUTED** | marketplace / discovery |
| **APIs get USED** | **comprehension, verification, memory**: Gecko |
Gecko **composes on top of** MCP, x402, and payment catalogs. It *consumes* them as
input. It is not a payment rail and not a marketplace. Building transactions belongs to
builders; signing belongs to signers. That is the design, not a gap.
## Control plane, never data plane
Gecko holds the API's *surface*, the generated tool defs, and *correctness metadata*. It
**never** stores response payloads, user data, or secrets. That invariant is what lets it
ingest a surface unilaterally, and it is a hard boundary, not a setting.
## Next
doctor → add → report → serve. The \$0 recorded path: no key, no spend.
The three views, with the interactive diagrams.
What a Receipt asserts, what the binding covers, and in detail what it does not.
Intent → the right starting point, with a provenance-tagged derive plan.
Surface, provenance, receipt, drift, question-shaped tool, the two modes.
What works today, and what is honestly not built yet.
# A real transaction
Source: https://docs.geckovision.tech/mainnet
An agent bought a bottle of water for 0.1 USDC on Solana mainnet. Gecko verified the call before it was signed, and the chain agreed.
Every other page here ends at a simulation. This one ends on chain, and the point is
simple enough to say in one line: **before the money moved, Gecko said exactly what would
happen, and that is exactly what happened.**
On 2026-08-06 an agentic wallet bought a bottle of water at a bar that takes crypto:
0.1 USDC, Solana mainnet, a real store, a real product. Before it was signed, Gecko
planned the call, simulated it against live mainnet, and bound the receipt to the exact
message. Then a wallet signed it and it landed.
## Check it yourself
[**Open this transaction on Solscan
↗**](https://solscan.io/tx/5cjBs5VE8WVVctG2EoUkYiRkW92sXkoT4YsNxszWC9CE3sK7triTJ5vnY6TrcQ2BRPYUtWsd3LtTnyieUfn8Hw2Y)
```
5cjBs5VE8WVVctG2EoUkYiRkW92sXkoT4YsNxszWC9CE3sK7triTJ5vnY6TrcQ2BRPYUtWsd3LtTnyieUfn8Hw2Y
```
| | |
| ----------- | ---------------------------------------------------------------- |
| what moved | 10 cents: buyer −0.1 USDC, bar +0.1 USDC |
| did it work | yes, no error |
| slot | 437633643 |
| compute | 36,508 units, the network's measure of work, matched to the unit |
Nothing on this page requires taking our word for it. Open the link, or ask a node
directly:
```bash theme={null}
curl -s https://api.mainnet-beta.solana.com -X POST \
-H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"getTransaction","params":
["5cjBs5VE8WVVctG2EoUkYiRkW92sXkoT4YsNxszWC9CE3sK7triTJ5vnY6TrcQ2BRPYUtWsd3LtTnyieUfn8Hw2Y",
{"maxSupportedTransactionVersion":0}]}' | jq '.result.meta.computeUnitsConsumed'
```
## Then we did it ten more times
One exact match can be luck. On 7 August 2026 the same agent bought ten more bottles,
0.1 USDC each, each one planned and simulated against live mainnet before it was signed.
**Every receipt predicted 36,399 compute units. The chain charged 36,399. Ten times out
of ten.**
| # | transaction | slot | consumed |
| -- | --------------------------------------------------------------------------------------------------------------------------------- | --------- | -------- |
| 1 | [`4yBoPqPc…srsv`](https://solscan.io/tx/4yBoPqPc6YqPQjEeC7RGXtgCH9XG9zyx7CXYQ4WdTijbrLWDvE8Yo4eKFU4JAannDtcZJY4BdJN9J1J6mnmrsrsv) | 437721653 | 36,399 |
| 2 | [`3GvCjqxu…wi5R`](https://solscan.io/tx/3GvCjqxuy5KBuyLRL4f9SKpJrETMNhM6FP4fXBpTzzQJVDW6tXvpfAovy4zFn3j4fSMh2VeJ8VAdxWVuak5Jwi5R) | 437721889 | 36,399 |
| 3 | [`3MM7QMLz…cHwb`](https://solscan.io/tx/3MM7QMLzpoZNcN2JSnBcSxDiWeDWJgbMHe7pHNcGfw6EAKXLTz5kEuAwg6pbxCnVgTzjBFfcEFFo1BQs2RVGcHwb) | 437722129 | 36,399 |
| 4 | [`zXsDSEQt…F5C8`](https://solscan.io/tx/zXsDSEQtZt24FkT4eeNpiu4aCB1HXUKPKCeEG291CdHPj6NnfhZzu1zkvvunrCBu7ei2uhoRtmytMDMD9kXF5C8) | 437722295 | 36,399 |
| 5 | [`o6Da6NZQ…FSi9`](https://solscan.io/tx/o6Da6NZQe4DFag8VNEGHqCY3zuYocfdWT7n7Z7tqNbAJFBg69pNsCSiN51HeDuouW6T6XQeHicVZaWrpsdRFSi9) | 437722451 | 36,399 |
| 6 | [`3VrHHuzi…Di2u`](https://solscan.io/tx/3VrHHuzi2gC5QjnXBdWRAb5nhDkEPowVuZBnMNCqac8Ty2NeuykAQm7GA44qXfUt5TzCL5yQH4Ussi6nvKqpDi2u) | 437722629 | 36,399 |
| 7 | [`4QBnD6Yc…8iRj`](https://solscan.io/tx/4QBnD6Yc6sGYzeCVmbi9CpJoZdRfjBEtwMRt8XWVdjpeXwBrM2ApQmHKUACTvX2t3FNxyDqErZNDTY3ifuwE8iRj) | 437722762 | 36,399 |
| 8 | [`2NBodoD8…5a1B`](https://solscan.io/tx/2NBodoD8VNg1wqUXaxNQJUKTpZ9gkmM445d9NZFXLygaYuxtDyDQsH2MSp8Mdd3BYHci9Q6EPMaCJBGBQWaP5a1B) | 437722902 | 36,399 |
| 9 | [`33NkTQ5u…WLW1`](https://solscan.io/tx/33NkTQ5uJL85AtpsLMbWJu9L1PT9dKA4jEm5bFW9b2TpKcP7pb3br2up1KiZWmrzBzyPHvWS98rEwpKv7ac3WLW1) | 437722993 | 36,399 |
| 10 | [`3i92aBEY…AMrs`](https://solscan.io/tx/3i92aBEYsbHBotKcpaB8SxWDWEULp2SuQcqyeShY8sDCzFWQq4MLaN6URreG4QdBF3qRGR3eSYpqQR72kD2wAMrs) | 437723077 | 36,399 |
The books balance to the unit: 1.0 USDC spent, and exactly 50,000 lamports of fees, ten
transactions at Solana's 5,000-lamport base fee.
**36,399, not 36,508.** The first purchase wrote a record into the store's account, so
the program does slightly different work now. Both numbers are correct for the state they
were measured against, which is the whole point, and why a receipt is taken at the moment
you sign rather than the day before.
## Then the agent did it without us
Every transaction above was signed by a key on a laptop. On 12 August 2026 that stopped
being true.
**The key moved into a hardware enclave and never came back.** Gecko asked a Privy server
wallet to sign; the private key has never existed on the machine that planned the
transaction, and nothing in Gecko can acquire one. The whole path (comprehend, plan,
simulate, bind, check the spend policy, sign, broadcast) ran in **one call, with no human
in the loop.**
| # | transaction | slot | consumed | signed by |
| -- | --------------------------------------------------------------------------------------------------------------------------------- | --------- | ---------- | ---------- |
| 12 | [`3kcngvKS…W5wR`](https://solscan.io/tx/3kcngvKSkfRze7UPc6v1MeeZvxZAR6VG8evoyoA2VGF1eG9MKGzg41838BCGRHqqQBDwQ4FpC8R6qSa18FRTW5wR) | 438850988 | 36,399 | an enclave |
| 13 | [`zqSHUEoT…fT6p`](https://solscan.io/tx/zqSHUEoTAD9W7KdNHV6bRZfXr6qzAjdqu2LNYfMarvg1JciDgwsNHU4WH7G273Keua6beEV76aDku7JiS3sfT6p) | 438887385 | 36,399 | an enclave |
| 14 | [`5FLvBcQw…u8UQ`](https://solscan.io/tx/5FLvBcQweiGDNuXxJ3VDxsvwzkyXB6YJame2fB4C6yWCfDMsyEskvuZNxTkspK7aDk5h8y7x8GkSp7sfpHw8u8UQ) | 438888470 | **22,527** | an enclave |
| 15 | [`4zhgdny6…oLi1`](https://solscan.io/tx/4zhgdny6Wh93XJ9M8hFBsky7oEVAWyv5ddg4h68XzHX2GnDr2c8zQnL4WyUXYVJ3LnS7TyWqEfv55M62bLgDoLi1) | 438920685 | 36,399 | an enclave |
| 16 | [`Hp77fgHF…dTX`](https://solscan.io/tx/Hp77fgHF85BduE3YiSPfCMYzBFercmiz66Sjh2F9DuNKx7fy9Z9jFEo4W6D9nj7xBE5QShKy9Gs7HBXCj6dxdTX) | 438937647 | 36,399 | an enclave |
**Sixteen transactions. Sixteen exact predictions.**
**#14 is the interesting one: 22,527 CU, not 36,399, and predicted exactly anyway.** It
bought from a *different* storefront (`geckocoffee`), one that was not on any wired list.
The agent derived the store's address from its name, read the store's own account off the
chain, decoded the merchant and the menu out of it (Espresso, 0.1 USDC) and walked the
same verify-then-sign path. Different store, different account state, different work,
different number. The receipt predicted that number to the unit, which is the property
this page exists to demonstrate: the prediction tracks the *state*, not a memorised
constant.
**The first attempt was refused, and by the right party.** The enclave's own policy engine
rejected it: `policy_violation`. Wallet policies there are deny-by-default *per method*,
and the policy attached to that wallet only described a method we deliberately do not
use, the one that signs **and broadcasts** in a single step. Gecko asks for a signature
and submits the bytes itself, so that the signed message can be re-checked against the
receipt *before* anything reaches the chain. A vendor that broadcasts for you turns that
check into a post-mortem.
Fixing it meant adding a rule for the method we do use, restricted to the exact programs
this purchase touches. Which means the program allowlist now exists **on both sides**: in
Gecko, and inside the enclave, where we cannot switch it off either.
**What this shows:** one instruction, predicted exactly, sixteen times across three days,
two storefronts and several account states, the last five with no key on the planning
machine.
**What it does not show:** breadth. This is one program. [The program
surface](/program-surface) is where that claim is made and measured separately.
**And one thing it does not show that we would rather say out loud:** three of the four
spending caps in that run are real controls, but the rolling velocity counter is a file
the same process can write. A compromised agent could reset its own budget. Moving those
caps into the enclave, where the program allowlist already lives, is the next piece of
work, not a finished one.
## A second program, and a token the store won't take
The section above says this shows one program. On 26–27 August 2026 it stopped being one.
A wallet held **USDG**. The espresso is priced in **USDC**, and `let_me_buy` pins classic
SPL Token in its IDL, so a Token-2022 mint has no path through it at all. Not a preference,
a structural fact about the program. Five transactions closed that gap end to end.
| # | signature | slot | predicted | charged | what it added |
| - | ---------------------------------------------------------------------------------------------------------------------------------- | ----------- | --------- | ------- | -------------------------------------------------------------------------------------------- |
| 1 | [`unFg5wYW…Aswj`](https://solscan.io/tx/unFg5wYW6n7v9iKa7t7NvzAJS2rjME2EBwnRb8tdsSRTr1gCpCjWo3kqNracWSe5wNR8SBvEvtdVvyQGSoCAswj) | 441,778,607 | 41,615 | 41,615 | the first DeFi swap, and the first mainnet transaction from an **auto-comprehended** program |
| 2 | [`3szbhgFo…Qq19`](https://solscan.io/tx/3szbhgFoFJ4NiNoziSt6ZsnWwwq9GxBF8TpDDN9C8FKYJXGw2ySaFBoB3Jm8UkADPoZEuxYpRUUumKjt5Dd3Qq19) | 441,797,280 | 41,607 | 41,607 | spent the remaining USDC, so "holds only USDG" became a fact on chain, not a framing |
| 3 | [`5c9KuuXj…ccFU`](https://solscan.io/tx/5c9KuuXjH2xVCwRitGV2oQJotRtaoU8WDG74CNpQXYt7MB3CDFkHKWgcvqzqrMHMbHMtrikBAiBdMTpe5KUZccFU) | 441,798,061 | 44,584 | 44,584 | USDG → USDC, the direction that had never landed |
| 4 | [`47bt1wUS…ft6kS`](https://solscan.io/tx/47bt1wUSw9RTqym5WRoPqM7zz4jb3gMgtgFbGvXjtkMdgCKNnfmZZxdmQ7vQwtqzYSKy5v4jGPQF6yvVnVzft6kS) | 442,020,951 | 44,827 | 44,827 | the same swap from a separate buyer: 250,000 USDG → 101,011 USDC |
| 5 | [`2d62xnim…17i4`](https://solscan.io/tx/2d62xnim4YqozhCQQCFcmidywvBWG5gyNtvA6n3ZFzspeeeFpi4rNGxDgpyTL8AssRyhgi3kiZitQrMMhuqo17i4) | 442,021,012 | 48,280 | 48,280 | **the espresso** |
**The venue was derived, not chosen, and it proves itself.** Given the pair of mints, the
pool is found by matching the Whirlpool account discriminator and the two mint fields at
offsets computed from the IDL, and then **each candidate's address is re-derived from its
own configuration, mints and tick spacing**. A pool that cannot reproduce its own address is
dropped. The search proposes; the seed recipe disposes. That is what makes a wrong field
offset refute itself instead of quietly returning a plausible wrong pool.
**Four well-formed wrong answers were waiting on the first of these**, and comparison caught
each one, not inspection.
The **pool address**: the surface first derived the fifth seed as a lookup on an adaptive
fee tier, which makes the pool underivable. It is a caller-supplied tick spacing, and the
wrong tier yields a real, valid, **wrong** pool.
The **tick arrays**: seeded with an ASCII *decimal string*, which the surface encoded as a
32-bit integer because that is how the IDL declares the argument. An argument's declared
type does not determine its seed encoding.
The **direction**: b→a walks ticks up and a→b walks down. Only the array holding the current
tick is shared between them.
The **USDG account**: derived under Token-2022, where our helper had been defaulting to
classic SPL, including in the agent-facing tool. One instruction, two different token
programs.
**And the trap that cost three transactions.** The wallet first funded with USDG *was* the
store's own authority, so the buyer's token account and the store's are one address, and
the payment would credit the account it debits. The plan check refuses that, correctly. But
by then the swaps funding that wallet had been paid for. The lesson is about *ordering*: a
structural refusal has to run **before** a route is quoted, or you pay for a route to a place
you were never able to reach. The check now runs first.
**What these five did not show at the time.** Every one was settled by a script run by
hand, and nothing shipped could yet look inside a wallet to answer *"buy an espresso, I
only have USDG"* with the conversion instead of the storefront. The section below is what
changed.
**On the predictions in this table.** The charged figures are read back from the chain and
re-checked by `scripts/mainnet_ledger.py --verify`. The predictions were recorded in the
running session's notes at the time and the receipt output was not kept, so they are
transcribed rather than captured: accurate against the chain, but a weaker record than the
earlier runs, where the prediction was written down before the transaction settled.
`docs/mainnet-swap-chain.md` in the engine repo states that distinction in full. We would
rather publish the difference than average it away.
## Since then: the hosted path, signed headless
By 2026-09-01 the same loop ran through the **hosted MCP surface**
(`mcp.geckovision.tech/orquestra/mcp`) with no script and no shell. The surface gained
`plan_payment` and `plan_swap`, so "I only have USDG" is now answered with a checked
route. `prepare_purchase` and `prepare_instruction` return unsigned bytes, a receipt, and
a `binding` at `exact` strength. A hosted signer signed them headless. The three
transactions below are the last three rows of the engine repo's ledger
(`docs/mainnet-ledger.jsonl`), which holds 50 landed mainnet transactions in total.
| # | signature | program | predicted | how |
| -- | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------ | -------------------------------------------------------------------------- |
| 24 | [`5T8sRyYY…ANJL`](https://solscan.io/tx/5T8sRyYYB93F5FAd1c14cD5BEYyvxEEdL2vJK7tV9spxZXqUx8gjfgWhABh2R9HPXd9kqZE5FMsvwRRysyMANJL) | let\_me\_buy purchase | 48,578 | hosted `prepare_purchase` receipt, signed headless via the PayBox SDK |
| 25 | [`3bUd6dF1…Rfy9g`](https://solscan.io/tx/3bUd6dF1RQ8Hfhw3PZBTyXQMFVkVtJ4W7hgdRd786eeBZUHnAjouUthorvGFMd434Lwp2QBvYetvoX7AECMRfy9g) | Orca Whirlpool swap | not recorded | hosted `plan_swap` + `prepare_instruction`, binding exact, signed headless |
| 26 | [`3gZbFhUz…7xPZ`](https://solscan.io/tx/3gZbFhUzZC6RQvunBYDE8NhW1VLGV8rz3RQzKCnwWEZvp3tKJw6E1fS6WhjXcRBdoGJzskaRkia8N8SdApTm7xPZ) | Orca Whirlpool swap, USDG → USDC | not recorded | hosted `plan_swap` + `prepare_instruction`, binding exact, signed headless |
Two honest notes. The ledger records no compute prediction for #25 and #26, so they
count as landed with an exact binding, not as exact predictions. And #24's first send
expired unlanded on the public RPC; the identical signed bytes, rebroadcast every \~1.5
seconds, landed in seconds. That measurement is why `submit_transaction` exists: it
verifies the signed bytes against the binding, sends, and rebroadcasts the same bytes
until they confirm or the blockhash budget is spent. Same bytes, same signature, so the
loop cannot double-spend.
## Three things had to agree
Gecko answered **will this work**: simulated, bound, PASS. The wallet answered **who
signs it**. The wallet's policy answered **are you allowed to spend this**, a single-
transaction limit, enforced independently.
Those are different guarantees, and none substitutes for another. A policy that approves
your spending limit cannot tell you the transaction reverts; a simulation that says it
lands cannot tell you whether you were allowed to make it.
**Gecko held no key and signed nothing.** It never does. What it relayed to the chain was
signed bytes that had been re-checked against the receipt's binding first, and that is the
only thing it ever relays.
## The part that didn't go to plan
The video re-runs the pre-flight live, and the numbers don't match:
```
the chain charged 36,508 CU
a pre-flight NOW 36,399 CU
```
109 units apart, because *this very purchase* wrote a record into the store's receipts
account, so the program does slightly different work now.
That's not a defect, and hiding it would have cost the more useful lesson:
**A receipt is true for the state it was taken against.** Take it at the moment you sign,
not the day before. It's the same reason a receipt's strongest binding expires with its
blockhash, about a minute.
For the record, the pre-flight run immediately *before* the send did predict 36,508
exactly. We don't show that on camera, because it can't be re-derived now that the state
has moved, and a demo that can't reproduce its own claim shouldn't make it.
## Do it yourself
The same pre-flight runs against any wired program:
```bash theme={null}
npx @geckovision/gecko prove "route a swap out of hyUSD" \
--bind input_mint=… --bind output_mint=… --bind amount=… --bind user=…
```
You get the call it chose, what it rejected, every account with where it came from, and a
receipt, before anything is signed or spent. To run the hosted loop instead, follow
[`agents.md`](https://www.geckovision.tech/agents.md).
Status, compute units, categorical failure class, the binding, and what it does not claim.
Seed recovery, provenance per account, and the gaps we flag instead of guessing.
# The MCP surface
Source: https://docs.geckovision.tech/mcp-surface
What an agent installs. A framework-agnostic MCP surface over any ingested API, plus a synthetic search_capabilities tool for intent-to-endpoint discovery.
Gecko exposes an ingested API to an agent through the **Model Context Protocol
(MCP)**. The surface is framework-agnostic and fully testable: it's a thin view over
the client with two methods, `list_tools` and `call_tool`.
A Solana [Program Surface](/program-surface) is served the same way, via
`gecko-orquestra --program `.
Want to see it without installing anything? The flagship hosted surface is one line in
Claude Code:
```bash theme={null}
claude mcp add --transport http gecko https://mcp.geckovision.tech/orquestra/mcp
```
That's 16 tools over Solana storefronts, Orca Whirlpool swaps, `find_start` and program
graphs. Every other client's wiring is in
[`mcp-config.json`](https://www.geckovision.tech/mcp-config.json), and the runbook is
[`agents.md`](https://www.geckovision.tech/agents.md). For a hosted HTTP API instead:
```bash theme={null}
claude mcp add --transport http gecko-txline https://mcp.geckovision.tech/txline/mcp
```
That's the TxODDS TxLINE World Cup API (18 first-call-correct tools, served recorded/\$0).
In Claude Code you can instead `/plugin install gecko-surf@geckovision`, which wires that
surface **and** the make-agent-ready workflow. See the [Quickstart](/quickstart).
## Connect it in one step
The fastest way to give an agent an API: run the CLI and paste the printed line. It
comprehends the spec, serves it over **Streamable-HTTP MCP**, and prints a one-click
"add" string for each host app.
```bash theme={null}
npx @geckovision/gecko https://api.example.com/openapi.json
```
```text theme={null}
MCP URL (Streamable HTTP): http://127.0.0.1:8000/mcp
Add it to an agent (one step):
Claude Code: claude mcp add --transport http your-api http://127.0.0.1:8000/mcp
Cursor: cursor://…/mcp/install?name=your-api&config=…
VS Code: vscode:mcp/install?…
```
* **Claude Code**: paste the printed `claude mcp add …` line.
* **Cursor / VS Code**: open the printed deeplink (click it, or paste it into the address bar).
Serving to a *remote* agent? Add `--public-url https://` so the add strings and
the DNS-rebinding `Host`/`Origin` guard use your public URL. (For an embedded, in-process
server there's also a stdio variant; see [Using it in code](#using-it-in-code) below.)
## What the agent sees
The surface lists every usable, question-shaped tool for the API **plus one synthetic
tool**, `search_capabilities`, so the agent can go from plain-language intent to the
right endpoint and then call it.
```json theme={null}
{
"name": "search_capabilities",
"description": "Find which endpoint/tool fits a natural-language intent. Returns ranked tool names you can then call.",
"inputSchema": {
"type": "object",
"properties": {
"query": { "type": "string", "description": "What you want to do, in plain language." }
},
"required": ["query"]
}
}
```
Each real tool is listed with only `name`, `description`, and `inputSchema`. Auth
plumbing and invocation metadata stay internal. Operations the current
[session](/access-and-auth) can't satisfy are not listed at all.
## The agent loop
Call `search_capabilities` with the goal in plain language → ranked tool names.
Read the question-shaped `description` and `inputSchema` of the top tool.
Call the tool by name with the inputs. Gecko builds the correct request,
injects auth, and returns the result.
## Using it in code
`McpSurface` wraps an `AgentApiClient` and is testable without any MCP SDK installed:
```python theme={null}
from gecko.client import AgentApiClient
from gecko.mcp_server import McpSurface
surface = McpSurface(AgentApiClient(spec), mode="recorded")
surface.list_tools() # search_capabilities + the API's tools
surface.call_tool("search_capabilities", {"query": "live odds for a fixture"})
surface.call_tool("get_odds_snapshot_fixtureId", {"fixtureId": 123})
```
## Running a real stdio server
For a live MCP server, `serve_stdio` wraps the surface with the `mcp` SDK. It is
import-guarded, so the surface and its tests work without the SDK installed.
```bash theme={null}
uv add mcp
```
```python theme={null}
from gecko.mcp_server import serve_stdio
serve_stdio("path/to/openapi.yaml", base_url="https://...", mode="recorded")
```
The MCP server is **thin transport**. All comprehension logic lives in the engine; the
server just parses input, calls the package, and formats output. Run it in `recorded`
mode for a \$0 surface, or `live` once a session is in place.
# A production API
Source: https://docs.geckovision.tech/pegana
What changed when an agent was pointed at a 43-operation stablecoin API — asked in plain Portuguese, answered on the first call, with no key.
[Pegana](https://api.pegana.xyz) is Brazilian stablecoin infrastructure on Solana: peg
state, depeg simulation, loop exposure, webhook keys — **43 operations across 39 paths**,
in production, used by real money.
It is also a *good* API. Run through our agent-readiness scorecard it grades **A
(100/100)** — first-call-correct 100, hygiene 100, agent-friendliness 100, security 100
(re-measured against the live spec on 2026-08-06; it scored 99 in July and improved).
That matters for everything below. A specification tells you what a call looks like. It
cannot tell you whether it will work — and that is structural, not a defect anyone can
fix by writing better docs. What follows is not a list of things Pegana got wrong. It is
a list of things **no specification can carry, at any version, at any quality** — which is
exactly why a good API is the honest place to show them.
Concretely: `GET /v1/assets/{symbol}/state` with `symbol` = `"string"` is precisely what
the spec permits. Live, it is a 404. The spec is right and the call still fails.
Every number on this page is measured from a real run against the live API. The
scorecard, the compression figure, and the cross-API join were all produced by the
commands in [quickstart](/quickstart) — nothing is estimated.
***
## The question is the interface
**Before.** An agent that wants a stablecoin's peg state has to know Pegana exists, work
out which of 43 operations answers that question, find that the path is
`/v1/assets/{mint}/state`, and handle authentication. Each of those is a separate chance
to guess wrong, and every wrong guess costs a round trip and a slice of the context
window.
**After.** The question *is* the interface. Asked in plain Portuguese —
```
qual o peg state do USDC?
```
it resolved to `GET /v1/assets/USDC/state` and came back:
```
USDC PEGGED $0.99975
```
First call, live, **no API key** — the operation is public, and Gecko knows which ones
are because auth is resolved per operation at call time rather than assumed for the whole
surface. The agent never sees a credential either way.
## The join lives between two APIs
**Before.** "Is the stablecoin in this headline still pegged, and what is it trading at?"
is one question that spans three surfaces — a news feed, Pegana, and a price source. The
fact that joins them is a token mint. No specification can declare a relationship to a
specification it has never heard of, so the join has to live somewhere else.
**After.** The mint join across **Pegana ↔ Birdeye ↔ Jupiter** is declared once, confirmed
against real responses, and then the composed chain plans correctly — offline, keyless,
\$0, before a single live call is made.
That is the difference between a list of tools and a graph: the agent doesn't rediscover
the connection on every task, and it doesn't invent one that isn't there.
## The context bill
**Before.** Pointing an agent at a 43-operation API means the raw surface competes with
the actual task for the context window. The agent spends budget reading about the API
instead of using it.
**After.** **79.3% compression** on this spec — 113,072 B of raw OpenAPI down to 23,382 B
of agent surface. Measured 2026-08-06, not estimated.
The number is the least interesting part. Shrinking a spec is easy if you're willing to
drop things; the constraint that makes it worth anything is that **first-call-correctness
is held while you do it**. Compression that starts producing wrong calls has not saved
you tokens, it has moved the cost somewhere harder to see.
***
## What actually changed
Not the model. Not the agent. Not Pegana's API — which grades A.
**What the call was built from.**
```bash theme={null}
npx @geckovision/gecko report https://api.pegana.xyz/openapi.json
```
```
mcp.geckovision.tech/pegana/mcp
```
# The Program Surface (on-chain)
Source: https://docs.geckovision.tech/program-surface
The on-chain twin of the Agent Surface. Comprehend a Solana program, recover the PDA seeds an IDL drops, and derive the accounts first-plan-correct.
## The same thesis, one layer down
An HTTP API has an OpenAPI spec; a Solana program has an on-chain instruction↔account↔PDA
graph. Both are surfaces an agent must understand before it can act, and both lose
something the agent needs: an Anchor IDL (or an `llms.txt` built from one) **drops the PDA
seed recipes**, so the agent derives the wrong accounts and the transaction fails.
The **Program Surface** is Gecko's on-chain surface: it recovers those seed recipes from
program source and derives the PDAs **first-plan-correct**, the accounts a naive IDL tool
omits or gets wrong.
## Gecko comprehends; the builder builds
Gecko does the **comprehension**, not the build. It recovers the dropped seeds and derives
the accounts. [Orquestra](https://github.com/berkayoztunc/orquestra) **builds** the
transaction against the program. Gecko fills the derivation gap, hands the plan to the
builder, simulates the bytes that come back, and returns them unsigned with a receipt.
**Gecko never signs** and never replaces the builder.
Control plane, on-chain too: Gecko derives addresses and returns a plan. It holds no keys,
signs nothing, and moves no funds, the same invariant as the HTTP path.
## Proven on four mainnet programs
Every derivation is verified against real mainnet accounts on a local `surfpool` fork,
`$0`, read-only, no signing, each program with a gap a naive IDL tool gets wrong:
| Program | The gap Gecko fills |
| ------------ | ---------------------------------------------- |
| Meteora DLMM | a helper-seeded root PDA the IDL drops |
| Pump.fun | a seed read from inside another account's data |
| ORE | a cross-program account the IDL mis-owns |
| MetaDAO | an IDL that declares no PDA seeds at all |
Jupiter is the fifth wired surface and is not in this table, because its gap is a
different kind. Its missing accounts are not derivable from *any* IDL. They are the legs
of a route an HTTP surface computed a second earlier, so they arrive tagged
`cross_surface` rather than recovered from seeds. Same plan, different mechanism.
Orca Whirlpool and `let_me_buy` have since landed on mainnet through the same path; see
[A real transaction](/mainnet).
## Serve one
```bash theme={null}
npx -y @geckovision/gecko orquestra --program meteora --stdio
# or, from PyPI:
uvx --from "gecko-surf[serve,solana]" gecko-orquestra --program meteora --stdio
```
Or use the hosted surface, which carries `find_start`, the program graphs, and the
money paths:
```bash theme={null}
claude mcp add --transport http gecko https://mcp.geckovision.tech/orquestra/mcp
```
Not sure where to start? Route an intent to the right (program, instruction) first:
```bash theme={null}
gecko orquestra find-start "swap SOL for USDC on meteora"
```
See [find\_start](/find-start) for the provenance-tagged derive plan it returns.
## Simulate before you spend
A derived account set is not yet a landed transaction. The plan goes to an external
builder, Gecko assembles the unsigned preludes, simulates, and returns a
**[Receipt](/receipt)**, pass, or a categorical revert class, before any signature
exists.
That loop is live-proven twice on a fork: a Pump.fun buy where the naive derive-only path
reverts with `AccountNotInitialized (3012)` and Gecko's bundle passes at 86,669 CU, and a
Meteora DLMM swap (wrap → swap across live bins → unwrap) at 81,964 CU. Both on a surfpool
mainnet fork, a mainnet-backed snapshot, **not mainnet**, simulation only, \$0, nothing
signed or broadcast.
## Before the signer
Two checks sit between Gecko and a key holder, and neither one is Gecko's opinion.
The anti-poisoning verdict gates a downstream custody or signing layer: it refuses to
sign for a tool Gecko quarantined, so the key holder only ever signs what Gecko cleared.
The binding proves the bytes. A passing receipt on a money path returns `binding`, a hash
over the exact message bytes that were simulated, at `exact` strength, which covers the
blockhash. `verify_signed_transaction` checks a signed transaction against it, and
`submit_transaction` refuses to relay bytes that do not verify. A signer that was handed a
substituted transaction is caught while it is still free.
Gecko comprehends the call; the builder builds it; the vault signs it; the binding says
they are all talking about the same bytes.
# Quickstart
Source: https://docs.geckovision.tech/quickstart
doctor → add → report → serve. Map any API into a verified graph your agent traverses. $0, offline, no key. Going live is a separate, deliberate step.
Four commands. No install, no clone, no Python. Nothing here reaches a real API until
you decide it should.
```bash theme={null}
npx @geckovision/gecko doctor # 1. check your environment
npx @geckovision/gecko add # 2. comprehend it, $0, no live call
npx @geckovision/gecko report # 3. get the scorecard: grade + findings
npx @geckovision/gecko serve # 4. your agent uses it over MCP
```
Or install once:
```bash theme={null}
npm install -g @geckovision/gecko # prebuilt binary, no Python needed
uv tool install "gecko-surf[serve]" # or pip, if you want the Python package
gecko add
```
`npm install -g` ships a prebuilt binary for macOS and Linux, so the CLI works with no
Python toolchain at all. Install the PyPI package instead when you want to import
`gecko` in your own code (`from gecko import AgentApiClient`).
**Handing these docs to a coding agent?** Point it at
[`/llms.txt`](https://docs.geckovision.tech/llms.txt), a compact, agent-readable map of
this site, or append `.md` to any page URL on this docs site for raw markdown (e.g.
`/quickstart.md`).
## No install at all: the hosted surface
The canonical setup lives on the landing site, not here:
* [`agents.md`](https://www.geckovision.tech/agents.md): the executable runbook an agent
follows, from wiring to a verified first call.
* [`mcp-config.json`](https://www.geckovision.tech/mcp-config.json): every client's
exact wiring (Claude Code, Claude web, Cursor, VS Code, any `mcp.json`).
For Claude Code, the flagship surface is one line:
```bash theme={null}
claude mcp add --transport http gecko https://mcp.geckovision.tech/orquestra/mcp
```
That surface carries 16 tools: real Solana storefronts (`list_stores`), Orca Whirlpool
swaps (`plan_swap`), `find_start`, program graphs, and the money path
(`prepare_purchase` → your wallet signs → `verify_signed_transaction` →
`submit_transaction`). No account, no key. The host serves ten surfaces; they are listed
at [`/.well-known/gecko.json`](https://mcp.geckovision.tech/.well-known/gecko.json) and
described at [`catalog.md`](https://www.geckovision.tech/catalog.md).
Or let a skill do the wiring and verify the first call:
```bash theme={null}
npx skills add GeckoVision/gecko-surf
```
That installs seven skills: `gecko-setup`, `use-any-api`, `api-agent-ready`,
`x402-payai-setup`, `anti-poisoning`, `skill-guard`, `read-js-docs`.
## The four steps
```bash theme={null}
npx @geckovision/gecko doctor
```
Reports your setup and the exact next command. It changes nothing and calls nothing.
```bash theme={null}
npx @geckovision/gecko add https://api.provider.com/openapi.json
```
**No `openapi.json`?** Plenty of good APIs never publish one. `add` takes whatever
you have:
```bash theme={null}
npx @geckovision/gecko add https://docs.someapi.com # recovers a draft spec from the docs
npx @geckovision/gecko add ./openapi.json # a file you already have
npx @geckovision/gecko add api.stripe.com # a bare domain: Gecko finds the spec
```
Everything ingested is treated as **untrusted input**: sanitized, quarantine-checked,
SSRF-guarded. No live call to the API is made.
```bash theme={null}
npx @geckovision/gecko report https://api.provider.com/openapi.json
```
A grade plus the specific, fixable findings: what an agent would get wrong on this
surface, and why. This is the artifact to hand a provider.
```bash theme={null}
npx @geckovision/gecko serve https://api.provider.com/openapi.json
```
Serves the comprehended surface over Streamable-HTTP MCP and prints one-click add
strings. Defaults to **recorded** mode: nothing reaches the real API.
## Plug it into your agent
```bash theme={null}
# Claude Code
claude mcp add my-api -- npx -y @geckovision/gecko serve --stdio
```
```jsonc theme={null}
// Cursor / VS Code / any MCP client: mcp.json
{
"mcpServers": {
"my-api": {
"command": "npx",
"args": ["-y", "@geckovision/gecko", "serve", "", "--stdio"]
}
}
}
```
Then your agent asks **questions**, not endpoints:
```
Which fixtures kick off in the next hour, and what are the current odds?
What is the peg state of USDC right now?
Plan a swap of SOL for USDC on Meteora, bin_step 4.
```
## Going live is a separate, deliberate step
```bash theme={null}
gecko auth set
```
The key goes to **your OS keychain**: never into `mcp.json`, never into a tool
definition, never into the model's context. Gecko resolves it at call time and sends it
only to the API's own host (out-of-band host anchoring). Keyless APIs skip this
entirely.
Nothing in the first four commands calls a real API or spends anything. `serve` and the
SDK default to **recorded**; live requires both a credential you set explicitly and an
explicit `--mode live`.
## Prove it offline first: \$0 recorded mode
Every path has a **recorded mode** that runs the *same code* but synthesizes the response
from the API's own schema: no network, no key, no spend. Falsify the calls before going
live.
```bash theme={null}
uv run python -m gecko.demo # goal → discover → correct call → data (recorded, $0)
```
The two modes differ **only at the transport edge**. See [Recorded mode](/recorded-mode).
## Try a hosted HTTP surface in 10 seconds
Give your agent a hosted, Gecko-comprehended HTTP API: no `pip`, no spec, no key:
```bash theme={null}
claude mcp add --transport http gecko-txline https://mcp.geckovision.tech/txline/mcp
```
That's **TxODDS TxLINE**, 18 first-call-correct tools over a World Cup API with a
two-token on-chain paywall a coding agent does *not* one-shot. Served **recorded**
(\$0/offline), so you explore the real surface without a subscription. For a live keyless
API, use `/pegana/mcp` the same way.
`claude mcp add` is Claude-Code-only. In **Cursor**, **VS Code**, or any MCP client, add
the same endpoint to your `mcp.json`. Transport is **MCP Streamable HTTP**
(`2025-11-25`), not SSE:
```jsonc theme={null}
{ "mcpServers": { "gecko-txline": { "type": "http", "url": "https://mcp.geckovision.tech/txline/mcp" } } }
```
Every client's block for every surface is in
[`mcp-config.json`](https://www.geckovision.tech/mcp-config.json).
## On-chain, in one command
```bash theme={null}
uvx --from "gecko-surf[serve,solana]" gecko-orquestra --program pumpfun --stdio
```
Gecko recovers the seeds the IDL drops, plans the full instruction, an external builder
builds it, and a [Receipt](/receipt) says whether it lands, **before any signature**.
```bash theme={null}
gecko orquestra find-start "buy token X on pump" # intent → the right start point
```
## Other ways in
Bundles the skills + a live demo surface.
```
/plugin marketplace add GeckoVision/gecko-surf
/plugin install gecko-surf@geckovision
/make-agent-ready https://api.example.com/openapi.json
```
For your own app or agent loop.
```python theme={null}
from gecko import AgentApiClient, public_session
client = AgentApiClient(spec, session=public_session())
hit = client.search("what you want")[0]
client.call(hit["name"], {...}, mode="recorded")
```
Recover a draft spec from the docs, then comprehend it.
```bash theme={null}
gecko from-docs https://api.example.com/docs
```
Review the draft (especially auth) before trusting it live.
First-call-correctness suites you can fail a build on.
```bash theme={null}
gecko test
```
## Good to know
Nothing here pipes a remote script into a shell. Run in order and you never take an
unchecked step:
1. **Check (no side effects):** `npx @geckovision/gecko doctor`, read-only; reports
your setup and the exact next step.
2. **Dry-run (\$0):** `gecko serve ` defaults to **recorded**: no request
reaches the real API, nothing is billed.
3. **Live:** add `--mode live` (and `gecko auth set ` first for a keyed API).
Gecko is open-source (Apache-2.0), installed from a public registry **with a live
SLSA provenance attestation** tracing the package to its CI build: verifiable, not
an opaque script. Control-plane only: it never stores your responses or your keys.
Gecko refuses to trust a spec's `servers[]` host when the spec was fetched from a
different origin (the token-exfil defense). Assert the real host yourself:
```bash theme={null}
npx @geckovision/gecko add \
https://raw.githubusercontent.com/GeckoVision/gecko-surf/main/gecko/examples/colosseum_copilot_openapi.json \
--base-url https://copilot.colosseum.com/api/v1 --mode live
```
`add` prompts once for your PAT, seals it, pins the host, and connects in live mode.
Drop `--mode live` to falsify the calls offline first.
Linux (x64 + arm64) and Apple Silicon Macs: one command, no Python. On an Intel Mac
or Windows, use the Python path (same CLI, your system's own certificates):
```bash theme={null}
uvx gecko-surf add api.stripe.com # no install, needs Python/uv
pip install gecko-surf && gecko add api.stripe.com # or a normal pip install
```
Serve behind an HTTPS tunnel with `--public-url https://` (trusted for the
Host/Origin guard). Gecko also runs a hosted host at `mcp.geckovision.tech`; the
root `/mcp` serves `comprehend_api` and `list_surfaces`, and each surface lives at
`//mcp`.
# The Receipt
Source: https://docs.geckovision.tech/receipt
Simulate before money moves. What a Receipt asserts, what the binding covers, what it deliberately does NOT, and the two paths to get one.
A **Receipt** is the output of Gecko's simulate engine. It closes a built transaction
into one legible, honest verdict, **before any money moves**.
The loop: intent → derive the full account set → external build → unsigned prelude
assembly → `simulateTransaction` against a node → **Receipt** → a `binding` over the
exact bytes. Only a passing Receipt with an exact binding hands back a transaction. The
signer is never Gecko.
## What a Receipt asserts
* **Would this transaction LAND** against a *snapshot* of on-chain state (`status`:
`pass` / `fail`), via `simulateTransaction` (`sigVerify:false`,
`commitment:"processed"`). The money paths (`prepare_purchase`, `prepare_instruction`,
`plan_swap`) simulate the exact bytes with `replaceRecentBlockhash:false`, so the
binding covers the blockhash the caller is about to sign over.
* **Why it wouldn't**, as a **categorical `revert_class`**, a stable string vocabulary:
`slippage`, `custom_program_error:`, `insufficient_funds`, `account_error`,
`other`. Never a fabricated dollar number.
* **Compute units** consumed (`units_consumed`).
* **Best-effort deltas**: `sol_delta` (post − pre lamports for the first tracked account)
and `tokens_received` (only when a token account is tracked and decodable, otherwise
`None`, never guessed).
* A **`network_label`** honesty caveat, present on every Receipt.
## What a Receipt does NOT do
Read this section before you build a policy on top of a Receipt. These limits are
deliberate, not gaps we intend to close by loosening the claim.
* It does **not predict price or slippage**, only whether the tx lands against a
snapshot.
* A fork/RPC result is **NOT mainnet**. The `network_label` says so; a surfpool-fork
Receipt is never presented as mainnet truth.
* It is **state-specific and it expires**. An exact binding dies with its blockhash,
about 60 seconds; the prepare result carries the budget as
`expires.last_valid_block_height` and `expires.blocks_remaining`. A receipt taken
before the buyer decided is a receipt for bytes nobody will sign. Re-running is free.
* It does **not quote a priority fee**. `SetComputeUnitPrice` defaults to 0 in the
simulated bundle; landing under mainnet load needs a fee the operator (or builder)
supplies. The Receipt's `units_consumed` is the honest input for the CU *limit*, not
the price.
* It **stores nothing**. The Receipt is returned to the caller and persisted nowhere
(the control-plane invariant). No payload, pubkey, or log line is written.
* It **never signs**. No keypair exists on any Gecko path. The one send path,
`submit_transaction`, relays signed bytes only after they verify at exact strength
against this receipt's binding, and refuses without one.
## Two paths to a Receipt
Hand a built plan (with `fee_recipient` supplied) to the `simulate` MCP tool on the
program surface; it builds, simulates, and returns the Receipt. One tool call, no
glue code. On the hosted orquestra surface, `prepare_purchase` and
`prepare_instruction` do this against a public mainnet RPC by default.
`plan_buy` returns a `simulate` recipe block: fill `fee_recipient`, POST `build_url`
to get the tx, then run `simulateTransaction` yourself. You own the loop; Gecko
supplies the correct account set and the recipe.
Either path, `fee_recipient` stays an **honest gap**: Gecko will not guess it; the caller
supplies it.
## The proof
Two live side-by-sides, both on a **surfpool mainnet fork** (a mainnet-backed state
snapshot, **not mainnet**), simulation only, \$0, nothing signed, nothing broadcast,
nothing stored.
| Case | Naive path | Gecko |
| ----------------------- | ---------------------------------------------------------- | ------------------------------------------------ |
| Pump.fun `buy` | ❌ reverts, `account_error`, `AccountNotInitialized (3012)` | ✅ passes, 86,669 CU |
| Meteora DLMM `swap` | ❌ reverts, derive-only, no ATAs/wrap/bin-arrays | ✅ wrap → swap → unwrap, 81,964 CU |
| Meteora pool derivation | ❌ stale 3-seed scheme derives the wrong pool, silently | ✅ correct 4-seed derivation, differential-proven |
The Pump.fun run reverts on the buyer's uninitialized ATA. The Gecko bundle passes
because it carries a curve-quoted `max_sol_cost`, the recovered `bonding_curve_v2`, the
buyback fee-recipient remaining accounts, an idempotent-ATA prelude, and a compute
budget. The Meteora run exercises the full native-SOL bundle: both ATAs idempotent, wSOL
wrap, the swap with the three bitmap-selected `bin_array` remaining accounts the IDL
never names, and a `CloseAccount` unwrap, one unsigned simulated transaction.
Compute-unit numbers are **measured per run** against a fork snapshot and can vary
slightly with on-chain state. The stable claim is the side-by-side verdict: the naive
path's revert class vs Gecko's pass. The `base_factor` derivation row is a separate
result and carries no CU number.
Both runs are re-runnable from the engine repo (they need `surfpool` on `PATH` and a
mainnet RPC), and their verbatim output is recorded in
[`docs/proofs.md`](https://github.com/GeckoVision/gecko-surf/blob/main/docs/proofs.md).
On mainnet, the same receipt has preceded 50 landed transactions as of 2026-09-01. See
[A real transaction](/mainnet).
## Recording an outcome (opt-in)
A run can append its **categorical** outcome (status, revert family plus public code,
compute units, slot, network category, and a values-free recipe hash; never a pubkey,
amount, or log) to a segregated series. The default is **record nothing**; it takes an
explicit `record_to` opt-in.
```bash theme={null}
gecko drift path/to/simulated.jsonl # exit 0 = stable, 1 = drift detected
```
That series is the episodic memory behind [Stay correct](/stay-correct).
## The binding
A passing receipt on a money path comes back with two more fields:
```
binding a hash over the exact message bytes that were simulated
binding_strength "exact": the hash covers the blockhash the caller will sign over
```
Between handing over bytes and getting a signature back, nothing of Gecko's runs. A
signer will sign a substituted transaction just as cleanly, and a custody backend
protects the key, never the action. So the prepare result's `next_step` orders the work:
sign, then `verify_signed_transaction` (signed bytes against the binding), then submit.
`submit_transaction` runs that check itself, at exact strength, before anything reaches
the wire, and refuses without a binding. Verifying after broadcast is a post-mortem;
verifying before it is a decision.
What the binding does not say: that this is the purchase the user wanted. It says the
signed bytes are the bytes a passing simulation attested, against the state observed at
that slot, for as long as that blockhash lives.
# Recorded mode ($0)
Source: https://docs.geckovision.tech/recorded-mode
One code path, two modes. Recorded mode synthesizes responses from the spec so you can prove the comprehension offline, for free, before going live.
Gecko runs **one code path in two modes**. `recorded` and `live` differ *only at
the transport edge* — same discovery, same tool selection, same request building. The
only difference is where the response comes from.
| Mode | Network | Cost | Response source |
| ---------- | ------- | ----------- | ------------------------------------------------ |
| `recorded` | none | \$0 | synthesized from the operation's response schema |
| `live` | yes | per the API | the real upstream API |
## Why recorded mode exists
The first deliverable for any live-API integration is a **free local simulation that can
falsify it offline**. Live smoke is the final check, never the primary debugger. If
the agent picks the wrong endpoint or builds a malformed request, recorded mode catches
it before a single network call — or a single cent — is spent.
Recorded mode proves the agent **selected the right call and built a well-formed
request**. It does not prove the upstream returns that exact data — for that, run
`live`. Recorded responses are schema-shaped samples, not real data.
## How the sample is built
For each operation, Gecko finds the success response schema (`200` / `201` /
`default`, JSON content) and synthesizes a minimal valid instance from it. The
generator is **deterministic** — the same schema always yields the same sample — and
walks the schema sensibly:
* honors `example`, then `default`, then the first `enum` value
* follows `anyOf` / `oneOf` (first branch) and merges `allOf`
* builds objects from `properties`, arrays from `items`
* emits typed placeholders for primitives (e.g. an ISO timestamp for a
`date-time` string), with a bounded recursion depth
This is what powers the `$0` demo: many real specs ship almost no response examples, so
to demo and validate without live calls, Gecko synthesizes from the schema.
## Running it
```bash theme={null}
uv run python -m gecko.demo # E2E recorded demo, $0
```
Or programmatically:
```python theme={null}
result = client.call(tool_name, args, mode="recorded")
# {
# "status": 200,
# "request": "https://.../api/odds/snapshot/123",
# "method": "GET",
# "data": { ... schema-shaped sample ... },
# "mode": "recorded"
# }
```
Switching to live is a one-word change once you have a [session](/access-and-auth):
```python theme={null}
result = client.call(tool_name, args, mode="live")
```
Because the path is identical, a green recorded run is a strong signal the live call
will be well-formed too — the remaining unknowns are purely network and credentials.
# Roadmap
Source: https://docs.geckovision.tech/roadmap
Live, building, exploring, and what we'll never build. Everything is labeled; the full honest split lives on Status.
We label everything. **Live** = run it today. **Building** = in progress, and we say so
in the present tense, not the past. **Exploring** = we want your input before we commit.
No vaporware on this page.
The exhaustive, honest split, including everything **not** built, is on
[Status](/status). This page is the direction.
## Live today
* **Any surface → a verified graph.** OpenAPI, human docs, `llms.txt`, Anchor IDLs, raw
program source. One command: `gecko add `.
* **Provenance on every edge**: `extracted` / `recovered` / `flagged` on-chain;
`EXTRACTED` → `DECLARED` → `INFERRED` → `CLAIMED` → `VERIFIED` / `REFUTED` on HTTP.
* **`find_start`**: intent → the right starting point, with a dependency-ordered derive
plan and an honest no-start below the retrieval floor. See [find\_start](/find-start).
* **simulate → Receipt**: a simulation before money moves, live-proven on a fork and on
mainnet. See [The Receipt](/receipt).
* **The binding.** `prepare_purchase`, `prepare_instruction` and `plan_swap` return a
`binding` over the exact simulated bytes at `exact` strength. `verify_signed_transaction`
checks the signed bytes against it, and `submit_transaction` refuses to relay anything
that does not verify. 50 landed mainnet transactions in the ledger as of 2026-09-01.
* **Hosted receipts.** The orquestra surface at `mcp.geckovision.tech/orquestra/mcp`
simulates against a public mainnet RPC and returns the receipt and the binding; no
local install.
* **Invisible auth**: the credential lives in your OS keychain and is injected at call
time. Never in a tool def, never in `mcp.json`, never in the model's context.
* **`$0` recorded mode**: falsify every call offline, from the schema, before you spend
a token.
* **The Scorecard**: `gecko report `, a grade plus the specific findings.
* **Correctness in CI**: `gecko test `.
* **Seven fail-closed security layers**, including an AST-enforced no-sign boundary on
the landing layer.
* **The categorical corpus + an N-confirmed drift detector**: `gecko drift `.
* **Hosted MCP**: one-click add to Claude Code / Cursor / VS Code. Every client's wiring
is in [`mcp-config.json`](https://www.geckovision.tech/mcp-config.json).
## Building
In progress. The primitives ship today; the scheduled pieces are being built.
* **The drift scheduler.** The detector works and the series reads back; we are building
the cadence that re-simulates on a schedule so the series accrues without you running
anything. Until then it accrues only when runs happen.
* **Catalog breadth.** 4,500 projects are listed and seven program configs ship
(Pump.fun, Meteora, Jupiter, ORE, MetaDAO, Orca Whirlpool, let\_me\_buy); we are widening
the auto-comprehend path so more of the catalog resolves without hand-authoring.
Non-Anchor generalization is proven once.
* **The TEE credential backend.**
## Exploring
Unbuilt. If one of these is the reason you'd adopt, tell us. It moves up.
* **A semantic/vector retrieval tier.** Deliberately OFF behind an evidence gate. It
flips only on **measured** lexical recall failure, not fashion, and one measured
negative result on embeddings is already on record.
* **Cross-customer episodic pooling.** Tenancy is local-only until a consent and egress
layer exists that we'd be willing to defend.
* **Response-level trust.** *"Is this response sane?"*, deliberately downstream of
comprehension and verification.
## What we'll never build
So the labels above stay credible:
* **No signing, no custody.** Gecko holds no key. Every money path ends in unsigned,
checked bytes plus a receipt with a binding; somebody else signs. The one send path,
`submit_transaction`, relays only signed bytes that verify against that binding.
Unsigned assembly for simulation is the one documented carve-out, and the landing
layer's no-sign boundary is AST-enforced.
* **No payment rail, no marketplace.** We compose on MCP, x402, and payment catalogs;
the provider charges you directly.
* **No storage of your API responses, request values, or secrets.** The corpus is
categorical *by construction*: a fail-closed allowlist, not a policy you have to
trust.
* **No browsable provider marketplace.** Point us at the surface; the flow is identical
for every API.
## Who pays
The **`gecko-surf` engine is free and open-source, forever**: Apache-2.0, complete,
self-hostable. Ingest, comprehend, verify, run it yourself.
**Developers never pay.** The hosted layer is what an API provider buys: a flat price per
API, no cut of an API call, no funds held. See [For API providers](/for-providers).
## Tell us what to comprehend next
The call that looked right and wasn't: the one the spec described perfectly and the API
still refused, or accepted and did the wrong thing. Open an issue and tell us. Public 👍s
rank what we comprehend next.
# Status
Source: https://docs.geckovision.tech/status
The honest split. What works today and is proven, and what is not built yet. Nothing on the "not built" list is claimed anywhere else on this site.
Two lists. Everything claimed elsewhere on this site is on the first one.
## What WORKS today (proven, live)
**Comprehension**
* Any OpenAPI or docs surface → question-shaped tools; auth invisible to the agent,
injected at call time. **14+ real specs validated; 0 expose an auth header.**
* A draft spec recovered from a human docs page, with claims marked `VERIFIED` /
`REFUTED` against reality rather than trusted.
* PDA seed recovery from Anchor IDLs **and** from program source (proven on a
no-IDL/Steel program), including recipes the IDL structurally drops or hides in
accounts that travel only as remaining accounts.
* Auto-comprehend-on-pick: point at a project → a generated program config,
**differential-proven equal** to hand-authored ground truth on 4 programs, plus an
explicit **measured overlay** of what could not be derived from any public surface.
**Knowledge**
* Provenance on every edge, one canonical vocabulary. Surface graph:
`EXTRACTED` > `DECLARED` > `INFERRED` > `CLAIMED` → `VERIFIED` / `REFUTED`.
Program graph: `EXTRACTED` / `RECOVERED` / `FLAGGED`.
* Real recovered facts a coding agent cannot get from the surface: Meteora's
`base_factor` 4th seed (the deprecated 3-seed scheme silently derives the **wrong**
pool), Pump.fun's `bonding_curve_v2` (required, invisible in the IDL), a fee-recipient
field resolved empirically by a refuting Receipt, the liquidity-bitmap bin-array walk
(the naive heuristic fabricates dead accounts).
* Cross-API correlation on **declared** value-domain joins, proven across three real
APIs.
**Projection**
* Hosted and local MCP; scale-adaptive tool listing (full defs withheld above scale,
recovered per tool on demand).
* Measured context cuts of **−77% / −89%** on two real specs, with
first-call-correctness held. Bytes measured; tokens estimated.
* `find_start`: intent → the right (program, instruction) start point, ranked, with a
dependency-ordered derive plan, provenance on every account, declared preludes, and an
honest no-start below the retrieval floor. See [find\_start](/find-start).
* The Scorecard (`gecko report`) and the Playground.
**Verify**
* The simulate→**Receipt** engine, live-proven twice on a **surfpool mainnet fork** (a
mainnet-backed snapshot, **not mainnet**), simulation only, \$0, nothing signed or
broadcast:
| Case | Naive path | Gecko |
| ----------------------- | ------------------------------------------------------ | ------------------------------------------------ |
| Pump.fun `buy` | ❌ reverts, `AccountNotInitialized (3012)` | ✅ passes, 86,669 CU |
| Meteora DLMM `swap` | ❌ reverts, derive-only, no ATA/wrap/bin-array preludes | ✅ wrap → swap → unwrap, 81,964 CU |
| Meteora pool derivation | ❌ stale 3-seed scheme → the wrong pool, silently | ✅ correct 4-seed derivation, differential-proven |
CU numbers are measured per run and vary slightly with on-chain state; the stable
claim is the side-by-side verdict. See [The Receipt](/receipt).
* On mainnet: the engine repo's ledger (`docs/mainnet-ledger.jsonl`) holds 50 landed
transactions as of 2026-09-01. Every row that records both a prediction and a charge
matches to the compute unit. See [A real transaction](/mainnet).
* The binding. `prepare_purchase`, `prepare_instruction` and `plan_swap` on the hosted
surface return the unsigned bytes, a receipt, and a `binding` over those exact bytes
(`binding_strength: exact`, which covers the blockhash). `verify_signed_transaction`
checks signed bytes against it. `submit_transaction` re-verifies at exact strength,
refuses without a binding, and rebroadcasts the same bytes until they confirm or the
blockhash expires.
**Memory**
* A categorical corpus (`observed` / `reported` / `synthetic` / `simulated` tiers) plus
an N-confirmed drift detector. Values-free by construction, and audited.
* The `simulated` tier is wired end to end: the landing orchestrators and the `simulate`
tool take an explicit `record_to` opt-in (**default: record nothing**), and
`gecko drift` reads the series back: categorical rows only, never a pubkey, amount,
or log.
**Security**
* Seven fail-closed layers: spec sanitizer · per-tool quarantine · image Skill Guard
(rendered-pixel payloads, encoded-content rescan) · SSRF netguard · out-of-band
auth-host anchoring · the signing gate that checks signed bytes against the receipt's
binding · an **AST-enforced** boundary that proves the landing layer contains no sign
or send path.
**Scale of the test surface:** 4,800+ tests passing (4,843 offline, measured 2026-09-02)
· 4 mainnet programs derivation-proven · 2 live receipt pairs on a fork · 50 landed
mainnet transactions in the ledger · a 4,500-project catalog listed.
## NOT built yet (honest)
Nothing below is claimed anywhere else on this site.
* **The drift scheduler**: re-simulation on a cadence. Today the series accrues only
when runs happen.
* **The TEE credential backend.**
* **Catalog breadth**: 4,500 projects listed, seven program configs shipped (Pump.fun,
Meteora, Jupiter, ORE, MetaDAO, Orca Whirlpool, let\_me\_buy). Non-Anchor generalization
is proven once; wider coverage is open.
* **Pump.fun sell round-trip**, ORE claim, MetaDAO fund executable intents.
* **The semantic/vector retrieval tier**: deliberately OFF behind an evidence gate. It
flips only on measured lexical recall failure, not fashion. One measured negative
result on embeddings is on record.
* **Cross-customer episodic pooling**: tenancy is local-only until a consent/egress
layer exists.
* **Live x402 billing**: stub by design.
## What Gecko is not
Gecko is **not the agent** and **not an orchestrator**. It never signs and never holds a
key. It does not build the transaction; an external builder does. It never proxies the
data plane. The one thing it sends to a chain is signed bytes that verify at exact
strength against a binding it issued (`submit_transaction`); without that binding it
refuses. It is not a payment rail and not a marketplace. It **composes on** MCP, x402,
and payment catalogs.
It does not verify that the data an API returns is *true*. It verifies that the call is
the right call and, on-chain, that the transaction would land.
## The open question
The engine and the proofs are real. The **breadth** (catalog scale), the **cadence**
(the drift scheduler), and the **payer** (who buys this) are the open frontier. Treat
this page as the source of truth, not a launch post.
# Stay correct
Source: https://docs.geckovision.tech/stay-correct
Drift — knowing when a provider breaks you. Content-addressed surfaces, the regenerable-tool model, the categorical corpus, and the N-confirmed drift detector. The scheduler is not built yet.
It's Saturday. Nobody shipped anything. Your agent is down anyway — upstream renamed a
field, moved a path, tightened an enum, and your hand-written client knew none of it. It
keeps sending the old shape; the API keeps returning 422; the agent keeps confidently
retrying a call that can no longer succeed.
A hand-written client is a **frozen snapshot of an API that doesn't hold still.** So is
the spec it was written from — nothing in a specification says when it stopped being true.
Every rename is a manual diff a human has to notice, read, and re-code. Multiply by the
Nth API and "keep the integrations correct" becomes a standing on-call burden.
## Why the generated-tool model changes the failure mode
Your agent never calls a hand-written client through Gecko — it calls **tools generated
from the spec.** Tool generation is a *pure function of the surface*: same spec in, same
tools out. If the source of truth moves, the tools move with it — you re-comprehend the
surface instead of hand-editing a client.
Gecko knows which surface a tool came from, down to the revision:
```
surface_rev = sha256(canonicalized spec)[:12]
```
Same spec → same `surface_rev`; any edit bumps it. It's a content fingerprint stamped on
the cached comprehension and on **every** correctness record in the corpus.
Honest split. **Shipped:** content-addressed surfaces, comprehension as a pure function
of the spec, the categorical corpus, and the N-confirmed **drift detector**
(`gecko drift`). **Not built:** the **scheduler** — the cadence that re-checks without you
running anything — and the op-level diff report. Today the series accrues only when runs
happen. See [Status](/status).
## The stay-correct loop
Re-fetch the spec, or re-simulate a known-good action. Doing this **on a cadence** is the piece we're building.
Recompute `surface_rev`. Unchanged? Nothing happened, stop.
Run the same comprehension engine on the new spec.
Old `surface_rev` vs new: what params were added, removed, renamed, retyped; what endpoints moved.
Emit the new tool defs from the new surface.
## The second signal: drift the spec never announced
Providers don't always tell you. The surface can stay byte-identical while the behaviour
underneath moves — a tightened validation, a re-deployed program, a changed default.
`surface_rev` sees none of that.
So Gecko keeps a second, behavioural signal: the **categorical corpus**.
A run can append its outcome to a series — status class, revert family plus public error
code, compute units, slot, network category, and a values-free recipe hash. **Never** the
response body, a param value, a pubkey, an amount, a log line, or a token. That's not a
policy: the writer is a fail-closed allowlist, closed-vocabulary and audited.
**Recording is opt-in and the default is record nothing.** It takes an explicit
`record_to` on the run. Gecko does not silently observe your traffic — and it can't,
because in the normal path your agent calls the API directly and Gecko is not in the data
path at all.
Gecko can also **generate its own episodes** rather than depending on your traffic: it
re-simulates a known-good action and records the categorical result. That's what makes
the drift signal work on-chain — "clean at slot S, reverts at S′" — without ever touching
your data plane.
Read the series back:
```bash theme={null}
gecko drift path/to/simulated.jsonl # exit 0 = stable, 1 = drift detected
```
Drift is **N-confirmed**: a single anomalous run is noise, not a verdict. It takes N
confirmations before the detector calls it.
## In one line
A hand-written client makes *you* the diffing engine: read the changelog, edit the code,
hope you caught everything before Saturday. Gecko makes the **surface** the source of
truth and the **tools a regenerable function of it** — so a change propagates instead of
rotting — and the corpus catches the drift that never showed up in a spec at all.
# Example: TxLINE trading agent
Source: https://docs.geckovision.tech/txline-trading-agent
Start a new Solana project with Gecko — an agent comprehends the paywalled TxLINE World Cup odds API, flags sharp moves, and settles a prediction market on-chain, with a policy-gated wallet. Runs $0 offline.
A complete, runnable use case for the whole thesis on one *painful, paywalled* API. A trader wants
a Solana agent that watches the World Cup and settles prediction markets. Starting from nothing —
with **Gecko as the brain** and a **policy-gated wallet as the hands** — the agent comprehends
[TxLINE](https://txodds.com) (odds behind a two-token on-chain paywall), flags **sharp moves**, and
settles a market against TxLINE's **on-chain Merkle proof**. The user reads no docs and writes no
integration code.
It runs **`$0` offline** (recorded feed + a sandbox wallet); mainnet swaps only the signer edge.
## See the whole thing in one run
```bash theme={null}
git clone https://github.com/GeckoVision/gecko-surf && cd gecko-surf && uv sync
uv run python -m examples.txline_sharp_agent.story
```
The user's *entire* on-chain surface is **three acts**: fund a wallet, set it up once, and
**authorize one policy** (`spend ≤ $50 for {subscription, settlement}`). Nothing else is on
the user — the agent does the rest.
One line turns TxLINE into **18 first-call-correct tools**. Auth-gated odds tools stay hidden
until a session can satisfy them, so the agent can't mis-call what it can't see. No docs, no
hand-written client.
```bash theme={null}
npx @geckovision/gecko add \
examples/txline_demo/spec/txline_openapi.yaml \
--base-url https://txline.txodds.com --mode recorded
```
The agent builds the on-chain subscribe transaction; the wallet signs it **within** the
authorized policy. Gecko never touches a key.
Successive odds snapshots run through the detector; a shift past the threshold is the trading
signal: `fixture 42 · Home 45.6% → 54.8% (+9.2pp) ⚡`.
The comprehended TxLINE surface is **anti-poisoning-checked** — a manipulated tool is
quarantined at comprehension, before the agent ever sees it. The agent maps the 3-stage
Merkle proof onto the on-chain `validate_stat` instruction and the wallet signs the settle —
the program never decides the outcome, the proof does.
The user did **3 acts** (fund · set up · authorize). The agent comprehended a paywalled API,
subscribed, caught the move, and settled a market — the wallet signing only within the policy,
**Gecko never holding a key or a dollar**.
## The agentic wallet in the middle
The user funds the wallet with the budgeted USDC. Funding is always the user's side.
One-time wallet setup (social login on a Privy/Phantom embedded wallet, or a `pay --sandbox`
ephemeral wallet for the `$0` demo).
One policy: a spend cap + an allow-list of purposes. The wallet signs **only** within it —
an over-cap request is refused.
**Gecko is the brain; the wallet is the policy-gated hands.** They meet at a `WalletSeam` — an
injected boundary, exactly like Gecko's `Session` seam — so the wallet is pluggable and Gecko is
never the signer.
* **Mainnet hands:** **Privy** (Solana instruction-level policy enforced in-enclave at signing) or
**Phantom** (embedded wallet + social login, MCP-native). **OKX OnchainOS** is a valid alternate.
* **The rail:** **pay.sh** sits *on top* as the x402 payment rail — the wallet signs, the rail
settles. (pay.sh is a rail, not a wallet.)
* **Deferred:** MagicBlock — its session keys only bind if the counterparty program integrated
them, so they don't provide bounded authority for an arbitrary third-party API.
Gecko is **control-plane only** — it never holds keys, funds, or response payloads. The offline
sim **profiles** transactions (via Surfpool's `surfnet_profileTransaction`) and **never signs or
broadcasts**. A real mainnet settle is always the user's own signed action, under the policy they
pre-authorized.
## Break it into parts
Each piece runs on its own, `$0` and offline:
| Command | What it shows |
| ------------------------------------------------------ | -------------------------------------------------------------- |
| `python -m examples.txline_sharp_agent.story` | **The whole use case, end to end** |
| `python -m examples.txline_sharp_agent.demo` | Comprehension + first-call-correct call + sharp-move detection |
| `python -m examples.txline_sharp_agent.settlement_sim` | A flagged move → the on-chain `validate_stat` settlement plan |
| `python -m examples.txline_sharp_agent.wallet_sim` | The 3-step agentic wallet, policy-bounded |
The example also bundles curated Solana subagents (`defi-engineer`, `solana-architect`,
`solana-qa-engineer`) and a Surfpool MCP config, so a forked project can build the on-chain
settlement side. See the example's [README on
GitHub](https://github.com/GeckoVision/gecko-surf/tree/main/examples/txline_sharp_agent).
## Going live
Recorded mode needs nothing. For live TxLINE data the user completes an on-chain subscription
(fund a wallet + sign — their action); the agent drives the guest → subscribe → activate handshake
and Gecko seals the two tokens in the OS keychain. Same tool-building code path — only the transport
edge changes. See [Access & auth](/access-and-auth).
`gecko add ` and your agent is calling it correctly, first try — then integrate a
policy-gated wallet the same way.
# Four programs
Source: https://docs.geckovision.tech/use-cases
What happened when an agent tried to call four live Solana programs on its own, and what changed once it could check first.
Four programs on Solana mainnet: **Pump.fun**, **Meteora DLMM**, **ORE**, and **MetaDAO**.
Each one published a machine-readable surface. Each one is used in production every day.
We pointed an agent at all four and asked the same question: *can it make this call?*
Nobody's API was wrong. Every one of them was **incomplete in a way the agent could not
see**, and the agent had only one way to find out.
All four calls, run twice each against a live fork during the recording: first from the
published surface, then with Gecko's plan. Every number on screen came off the wire in
that take; the run streams its results in as they land, so a flow that can't run says so
rather than being staged. It's its own run, so its numbers differ slightly from the ones
below. Each one discovers live state (which pool, which funder) before it simulates.
Every number below came from a run against a live surfpool mainnet fork: no signature,
no broadcast, \$0. A fork is not mainnet, and compute units vary per run. The commands to
reproduce each one are in [proofs](https://github.com/GeckoVision/gecko-surf/blob/main/docs/proofs.md).
***
## Pump.fun: the account that exists only in prose
**Before.** An agent reads the IDL, assembles the sixteen accounts it names, and submits
a buy. The transaction reverts: `AccountNotInitialized (3012)`. The buyer has never held
this token, so their token account doesn't exist yet, and nothing in the schema says it
must. The agent had no way to know, and only one way to find out.
A sell is worse. It reverts with `InvalidBondingCurveV2 (6074)` **after** transferring the
tokens. The account it's missing, `bonding_curve_v2`, is required, but it appears nowhere
in the IDL's account list. It's mentioned once, in a sentence, in a doc comment.
**After.** Gecko recovers that account's derivation and reads the buyer's state to decide
whether the token account needs creating. It also reads a boolean at byte 82 of the bonding
curve to know whether this is a cashback coin, which changes the account count from 16 to
17\. The plan is handed to the builder, simulated, and comes back:
```
buy ✓ PASS 86,670 CU
sell ✓ PASS 50,783 CU
```
## Meteora DLMM: the pool that couldn't be found
**Before.** The agent asks the builder to derive `lb_pair`, the pool account every swap
starts from. The answer: **"no PDA seeds."** Not a wrong address: no address at all. The
seed recipe uses a helper function, and Anchor's IDL format has no slot for that
([issue #4057](https://github.com/solana-foundation/anchor/issues/4057), confirmed by a
maintainer). Nothing downstream can be derived, so nothing can be built.
There was a second, quieter problem. The pool derivation gained a fourth seed in 2024.
A tool using the old three-seed recipe doesn't error. **It derives a different pool, silently.**
**After.** Gecko recovers the seed recipe from the SDK source, including the fourth seed,
and derives the pool that actually holds the liquidity. Then it reads the pool's liquidity
bitmap to select which bin arrays the swap will cross. The obvious guess (the active bin
and its neighbours) points at accounts that don't exist. Wrap, swap, unwrap:
```
swap ✓ PASS 81,964 CU
```
## ORE: when the published spec disagrees with the program
**Before.** ORE is built with Steel, not Anchor, so there is no generated IDL. The project
publishes one by hand, and the builder serves it. An agent following it produces a
transaction that transfers the tokens and then dies: **`writable privilege escalated`.**
The published spec marks the `board` account read-only. The deployed program writes to it.
We checked the last 193 mainnet instructions of one kind: **193 of 193** carried two
accounts the spec doesn't list. An argument is missing entirely. A struct is 208 bytes off.
This is the sharpest version of the problem, because nothing here is fixable by reading
more carefully. **A valid document can disagree with reality, and only reality settles it.**
**After.** Gecko takes the account roles from the deployed program's source, corrects the
metadata the spec got wrong, and refuses to plan a claim for an authority the program will
reject rather than hand back something that looks fine and isn't:
```
claim ✓ PASS 41,023 CU
```
## MetaDAO: nothing to derive at all
**Before.** The builder's PDA finder returns **zero** accounts for this program. Not partial.
None. The published IDL carries no seed recipes, so an agent cannot construct the call in
the first place. There's no revert to debug, because there's no transaction to submit.
**After.** Gecko recovers all three account derivations from the deployed program's source
and assembles the full account set.
Then something honest happened: **the naive path also lands here.** Once the accounts are
filled in, the raw instruction succeeds. This funder already held the token account, and
the program creates its own funding record. MetaDAO's gap isn't a missing prelude. It's that
you cannot derive the accounts at all.
```
fund ✓ PASS 44,476 CU (and the naive path lands too, once the accounts exist)
```
We keep that in the set because the true story per program is whatever is true. Three of
these four reverted. One didn't. Pretending otherwise would make the other three less
believable.
***
## What actually changed
Not the model. Not the agent. Not anyone's API.
**The information the call was built from, and the chance to try it before it counted.**
| | Before | After |
| -------- | ---------------------------- | ----------------------- |
| Pump.fun | reverts (3012 / 6074) | ✓ 86,670 CU · 50,783 CU |
| Meteora | pool cannot be derived | ✓ 81,964 CU |
| ORE | writable privilege escalated | ✓ 41,023 CU |
| MetaDAO | nothing to derive | ✓ 44,476 CU |
Every account in those plans carries where it came from: `extracted` from the published
surface, `recovered` from program source, or `flagged` when we genuinely don't know. A
flagged account is never guessed.
**Gecko comprehends the call. [Orquestra](https://github.com/berkayoztunc/orquestra) builds
the transaction. A vault signs it.** We never hold a key and never sign. The simulation
runs on an unsigned transaction, which is the whole point, and the receipt's binding is
what lets the signed bytes be checked against it before they are relayed.
```bash theme={null}
uvx --from "gecko-surf[serve,solana]" gecko-orquestra --program pumpfun --stdio
```