# ForwardLane API quickstart: query a financial code knowledge graph

ForwardLane's agent storefront sells a code knowledge graph built from ForwardLane's private financial-services repositories. You query it over plain HTTP with no account and no API key. Graph statistics at `GET https://agents.forwardlane.com/zcj/vqvdkwrczwqp/api/stats` cost $0, and a repository listing at `GET https://agents.forwardlane.com/zcj/vqvdkwrczwqp/api/repos` costs $0.02. Each call first answers with a 402, a price quote that you pay over x402 or MPP and then retry, so nothing is charged until you pay.

## At a glance

- **Endpoints:** `GET https://agents.forwardlane.com/zcj/vqvdkwrczwqp/api/stats` returns graph totals. `GET https://agents.forwardlane.com/zcj/vqvdkwrczwqp/api/repos` returns repository records.
- **Query parameters for the listing:** `sort_by` (default `composite_score`), `sort_order` (`asc` or `desc`), `tier`, `language`, `project`, `min_commits`, `min_contributors`, `page`, `page_size` (1 to 500, default 50)
- **Price:** statistics $0. A repository listing costs $0.02 at any `page_size`.
- **Payment:** a 402 price quote, paid over x402 (Base USDC) or MPP (Tempo USDC), then the same request retried. No signup and no API key.
- **Response:** JSON. Statistics return `total_repos`, `by_language`, `by_tier`, `by_project`, `total_edges` and `edge_types`. The listing is paginated as `items`, `total`, `page`, `page_size` and `total_pages`.
- **Scope:** synchronous reads about the repositories ForwardLane analysed
- **Full purchase flow:** [the buyer skill](https://agents.forwardlane.com/zcj/vqvdkwrczwqp/SKILL.md)

## Make a first call to the code knowledge graph API

1. Request the graph statistics without a payment:

   ```bash
   curl -si https://agents.forwardlane.com/zcj/vqvdkwrczwqp/api/stats
   ```

   The storefront answers `402 Payment Required`. The body carries `payment.amountUsd`, the `plan` and a `protocols` block with one challenge per wallet rail. The same challenges also arrive as headers: `payment-required` for x402 and `www-authenticate` for MPP. For this call the quote is $0.

2. Sign the 402 with your x402 or MPP client and retry the same request. A zero quote still needs a wallet signature. The example call settled a zero-amount payment and took 2.9 seconds. The response is a JSON object with `total_repos`, `by_language`, `by_tier`, `by_project`, `total_edges` and `edge_types`. Its `edge_types` counted `SHARED_DEPENDENCY`, `IMPORTS`, `USES_DEPENDENCY` and `SIMILAR_STRUCTURE` edges.

   For code-level counts of functions, classes, models, endpoints and findings, call `GET https://agents.forwardlane.com/zcj/vqvdkwrczwqp/api/deep-stats`, which uses the same meter.

3. List the highest-scoring repositories:

   ```bash
   curl -si "https://agents.forwardlane.com/zcj/vqvdkwrczwqp/api/repos?sort_by=composite_score&page_size=3"
   ```

   The 402 quotes $0.02. Pay it and retry the identical request.

4. Read the records. The example below paid $0.02 for three records. This excerpt shows one record with some of its fields:

   ```json
   {
     "items": [
       {
         "name": "forwardlane_advisor",
         "language": "nodejs",
         "project": "Client Applications",
         "commits": 500,
         "contributors": 12,
         "api_endpoints": 189,
         "composite_score": 43.29,
         "tier": "tier2_needs_work",
         "pipeline_grade": "B",
         "has_ci": 1
       }
     ],
     "page": 1,
     "page_size": 3
   }
   ```

   Each record carries many fields, for example:

   - size and activity, such as `commits`, `functions` and `total_loc`
   - graph centrality, such as `pagerank` and `centrality_composite`
   - `composite_score`, with its `dim_` breakdowns, and `tier`
   - diligence signals, such as `test_coverage_pct`, `has_ci` and `bus_factor`


## Filter and page the repository listing

The price is fixed per query, so a `page_size` of 500 costs the same as 3.

| To get | Set |
| --- | --- |
| Highest score first | `sort_by=composite_score`, `sort_order=desc` (both defaults) |
| One tier | `tier=tier2_needs_work` |
| One language | `language=<language>` |
| One project group | `project=<project group>` |
| Established repositories | `min_commits=<n>`, `min_contributors=<n>` |
| The next page | `page=2` |

## The six ForwardLane services

Every service works the same way: one request, one 402, pay and retry. Each service's API reference is at `https://agents.forwardlane.com/zcj/vqvdkwrczwqp/services/<slug>/openapi.json`, and the [services catalog](https://agents.forwardlane.com/zcj/vqvdkwrczwqp/services) lists every service and price.

| Service | What it sells | Example path | Price |
| --- | --- | --- | --- |
| Code Knowledge Graph | Repositories, functions, classes, data models, endpoints and contributors with typed edges; keyword code search; a full graph export | `/api/functions`, `/api/search/hybrid?mode=bm25`, `/api/graph` | $0.02; search $0.05; export $0.05 |
| Code Quality Scores | Composite scores with six dimensions, tier rankings and score history | `/api/rankings` | $0.05 |
| FIBO Ontology Code Mapping | Functions that implement a financial-ontology concept, ranked with confidence | `/api/skills/by-ontology` | $0.05 |
| Security Findings | Static findings per repository, filtered by severity, billed per finding returned | `/api/security` | $0.10 |
| SWE-bench Task Instances | SWE-bench format tasks minted from these repositories; the full record holds the problem statement, base commit, gold patch and test lists | `/api/benchmark/tasks/{instance_id}` | $10 |
| Technical Due Diligence | Executive summaries, factor reports and deep packets from a 37-metric matrix | `/api/dd/executive/{repo}`, `/api/dd/deep/{repo}` | $0.05; deep packet $1 |

## Limits

- Every endpoint is a read that returns JSON. The data describes the repositories ForwardLane analysed. It does not analyse your own code.
- Each pay-as-you-go call is its own 402 and its own charge. An unpaid 402 charges nothing, so you can stop at any quote.
- A repository listing costs less than the card floor of $0.50 per call, so pay it from a wallet, or buy Credits and draw each call from the balance ([the buyer skill](https://agents.forwardlane.com/zcj/vqvdkwrczwqp/SKILL.md) covers buying them).
- Security findings of the credential class (hardcoded keys, passwords, tokens) show only the directory, not the file name.
- After a paid call is forwarded, ForwardLane's API returns its own status and body, including its own errors.

## Errors

| Response | Meaning | Action |
| --- | --- | --- |
| `402` with a `payment` block | The price quote. Nothing is charged yet. | Pay and retry the same request, or stop |
| `422` | A validation error on a query value | Fix the value against the API reference |
| `settlement_failed` | The signed payment did not settle. `settlementReason` says why. | Fix the wallet, then start again for a fresh 402 |
| `payment_request_mismatch` (409) | A payment was reused for a different request | Request a fresh 402 for the new request |
| `payment_provider_unavailable` | A transient failure reaching the payment provider | Retry unchanged, with backoff |

Every other code is in the [error reference](https://agents.forwardlane.com/zcj/vqvdkwrczwqp/errors.md).

## Frequently asked questions

### Does ForwardLane's code intelligence API need an API key or account?

No. You pay each call's 402 and retry the same request; [the buyer skill](https://agents.forwardlane.com/zcj/vqvdkwrczwqp/SKILL.md) covers the full flow.

### How much does a repository listing cost?

$0.02. The price is fixed per query whatever the `page_size`, up to 500 records per page. Ten listings cost $0.20.

### Is the graph statistics call free?

Yes: `GET https://agents.forwardlane.com/zcj/vqvdkwrczwqp/api/stats` costs $0. It still answers with a 402 that your x402 or MPP client signs before you retry. A card cannot pay it, because a single card payment has a floor of $0.50.

### Can I pay for graph queries by card?

Not per call, because a graph query costs less than the card floor. Buy Credits by card instead, and draw each query from the balance.

### Does the dataset include my own repositories?

No. The storefront sells data about the financial-services repositories ForwardLane analysed. It does not take or analyse other code.

## Keep reading

- [Buyer skill](https://agents.forwardlane.com/zcj/vqvdkwrczwqp/SKILL.md): the full purchase flow
- [Code Knowledge Graph API reference](https://agents.forwardlane.com/zcj/vqvdkwrczwqp/services/code-knowledge-graph/openapi.json): every parameter and response schema
- [Services and prices](https://agents.forwardlane.com/zcj/vqvdkwrczwqp/services): all six services
- [How to pay](https://agents.forwardlane.com/zcj/vqvdkwrczwqp/payment.md): x402, MPP, card and Credits
- [Error reference](https://agents.forwardlane.com/zcj/vqvdkwrczwqp/errors.md): every code and what to do

---

Updated 2026-10-26. All ForwardLane guides: https://agents.forwardlane.com/guides.md. Storefront: https://agents.forwardlane.com/zcj/vqvdkwrczwqp/llms.txt.
