docspack v1.2.0
Endpoints

docspack.dev

The machine-readable half of docspack.dev.

Every route here is a static file served from the edge: no credential, no rate limit, no state. They exist because an agent reading this site should not have to scrape HTML for the specification, the manual or the measurements behind the numbers on the landing page.

This document is itself served at /openapi.json, and it is what renders the page you are reading — the same source produces a reference a person reads and a digest an agent is answered from.

Base URL
https://docspack.dev
Authentication
None. Every route is a static file, so there is no credential to send and no rate limit to hit.
Operations
14

For an agent: /api.lapis — the whole API in the notation docspack answers with, about a tenth of the tokens. One endpoint: /api/<operationId>.md . The document itself: /openapi.json.

Every route here is a public GET. For what the same page does with a bearer token, a request body and a DELETE, see the worked example.

agents

Routes written for a model rather than a browser.


GET/llms.txt

The site's table of contents for an agent.

An llms.txt index: one line per document, each with a link and a one-line description. Start here, then fetch what the question needs.

Authentication

No credential required.

Response

200The index.

Request

cURL

bash
curl -X GET 'https://docspack.dev/llms.txt'

JavaScript

js
const response = await fetch("https://docspack.dev/llms.txt", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/llms.txt",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/llms.txt", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.


GET/llms-full.txt

Every document on the site, concatenated.

The whole corpus in one response. Useful for a one-off ingest; for a question about one thing, /llms.txt and one page cost far less.

Authentication

No credential required.

Response

200The corpus.

Request

cURL

bash
curl -X GET 'https://docspack.dev/llms-full.txt'

JavaScript

js
const response = await fetch("https://docspack.dev/llms-full.txt", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/llms-full.txt",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/llms-full.txt", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.


GET/ai-rules.md

The block `docspack agent install` writes, as Markdown.

Authentication

No credential required.

Response

200The rules.

Request

cURL

bash
curl -X GET 'https://docspack.dev/ai-rules.md'

JavaScript

js
const response = await fetch("https://docspack.dev/ai-rules.md", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/ai-rules.md",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/ai-rules.md", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.


GET/api.lapis

This API in LAPIS notation, for a model.

The same document as /openapi.json, rendered in the notation docspack answers with. Around a tenth of the tokens, and the one artifact here that grows with the size of the API — for a question about a single endpoint, fetch that endpoint’s digest instead.

Authentication

No credential required.

Response

200The document.

Request

cURL

bash
curl -X GET 'https://docspack.dev/api.lapis'

JavaScript

js
const response = await fetch("https://docspack.dev/api.lapis", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/api.lapis",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/api.lapis", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.


GET/api/{operationId}.md

Everything needed to call one endpoint, and nothing else.

The base URL, the credential, the inputs with their types, the response, the failures, the types they reference, and a runnable curl call — for one operation. This is the densest form of the question “how do I make this request”.

Authentication

No credential required.

Path parameters

  • operationIdstrrequired

    An operation's id, as listed in /api.lapis.

Response

200The digest.

Errors

404No operation with that id.

Request

cURL

bash
curl -X GET 'https://docspack.dev/api/getDocPage.md'

JavaScript

js
const response = await fetch("https://docspack.dev/api/getDocPage.md", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/api/getDocPage.md",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/api/getDocPage.md", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.

An operation's id, as listed in /api.lapis.

manual

The documentation, as its own source.


GET/docs/{slug}.md

One page of the manual, as the Markdown it already is.

The same bytes the page at /docs/{slug} is rendered from, with no HTML shell. A ::: presentation block is replaced by what it wraps, so the page a reader sees and the text an agent is given describe the same behaviour.

Authentication

No credential required.

Path parameters

  • slugstrrequired

    A page's slug, as listed in /llms.txt.

Response

200The page.

Errors

404No page with that slug.

Request

cURL

bash
curl -X GET 'https://docspack.dev/docs/searching.md'

JavaScript

js
const response = await fetch("https://docspack.dev/docs/searching.md", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/docs/searching.md",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/docs/searching.md", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.

A page's slug, as listed in /llms.txt.


GET/docs/search.json

The manual split into searchable sections.

The same sections docspack build would cut, so a section found here is the chunk a model would have been given. Ranking is deliberately not included: emitting a corpus and ranking one are different jobs.

Authentication

No credential required.

Response

200The index.
  • versionintrequired

    Bumped when the record shape changes in a way a reader would notice.

  • records[SearchRecord]required
    • slugstrrequired

      The page's slug, for the URL.

    • titlestrrequired

      The page's title.

    • headingstrrequired

      The section's heading. Equal to the title for the text above the first `##`.

    • anchorstrrequired

      Fragment on the page. Empty for the lead section.

    • textstrrequired

      The section's prose, with Markdown syntax reduced to the words in it.

json
{
  "version": 0,
  "records": [
    {
      "slug": "string",
      "title": "string",
      "heading": "string",
      "anchor": "string",
      "text": "string"
    }
  ]
}

Request

cURL

bash
curl -X GET 'https://docspack.dev/docs/search.json'

JavaScript

js
const response = await fetch("https://docspack.dev/docs/search.json", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/docs/search.json",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/docs/search.json", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.

measurements

The runs behind every number on the site.


GET/benchmarks.json

What a query costs, measured.

The object bench/results.json holds, served verbatim: every percentile and the machine it was taken on. A benchmark a reader cannot inspect is a claim.

Authentication

No credential required.

Response

200The run.
  • latency{coldAsk?: Timing, nodeBaseline?: Timing}required

    Cold-start timings, split so that Node's own startup is not counted as docspack's work.

    • coldAskTiming
      • nintrequired

        How many runs.

      • p50floatrequired
      • p95floatrequired
      • minfloatrequired
      • maxfloatrequired
    • nodeBaselineTiming
      • nintrequired

        How many runs.

      • p50floatrequired
      • p95floatrequired
      • minfloatrequired
      • maxfloatrequired
  • context{corpusTokens?: int, queries?: [{query?: str, tokens?: int}]}required

    What an answer costs against the size of the corpus it came from.

    • corpusTokensint
    • queries[{query?: str, tokens?: int}]
      • querystr
      • tokensint
  • network{estimatedTokens?: int}

    What fetching the same documentation over the web would have cost.

    • estimatedTokensint
json
{
  "latency": {},
  "context": {}
}

Request

cURL

bash
curl -X GET 'https://docspack.dev/benchmarks.json'

JavaScript

js
const response = await fetch("https://docspack.dev/benchmarks.json", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/benchmarks.json",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/benchmarks.json", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.


GET/coverage.json

How much of a library its own documentation covers.

bench/coverage.json, including the sample of exported names each library documents nowhere. Produced by comparing a library’s published documentation against the same library as installed.

Authentication

No credential required.

Response

200The run.
  • targets[LibraryCoverage]required
    • librarystrrequired
    • versionstrrequired
    • coverage{names?: int, documented?: int, undocumented?: int, onDisk?: int, marked?: int}required
      • namesint

        Every name an entry point in the `exports` map publishes.

      • documentedint

        How many of those the library's own documentation mentions anywhere.

      • undocumentedint
      • onDiskint

        How many undocumented names the installed build declares.

      • markedint

        The same count, dropping names the library marks internal by convention.

json
{
  "targets": [
    {
      "library": "string",
      "version": "string",
      "coverage": {}
    }
  ]
}

Request

cURL

bash
curl -X GET 'https://docspack.dev/coverage.json'

JavaScript

js
const response = await fetch("https://docspack.dev/coverage.json", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/coverage.json",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/coverage.json", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.

specification

The docs-package format itself.


GET/schema/v1.json

The JSON Schema for a docs package's manifest.

The URL docspack build writes into every manifest as $schema, and the one a validator fetches. It resolves at exactly this path because the $id inside the document says so.

Authentication

No credential required.

Response

200The schema, as a JSON Schema document.
json
{}

Request

cURL

bash
curl -X GET 'https://docspack.dev/schema/v1.json'

JavaScript

js
const response = await fetch("https://docspack.dev/schema/v1.json", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/schema/v1.json",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/schema/v1.json", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.


GET/spec.md

The docs-package specification, as Markdown.

The chunk-id grammar, the path-escape rule and what every manifest field means.

Authentication

No credential required.

Response

200The specification.

Request

cURL

bash
curl -X GET 'https://docspack.dev/spec.md'

JavaScript

js
const response = await fetch("https://docspack.dev/spec.md", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/spec.md",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/spec.md", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.


GET/openapi.json

This document.

The OpenAPI 3.1 description of these routes, which is what the reference page and the per-operation digests are generated from.

Authentication

No credential required.

Response

200The document.
json
{}

Request

cURL

bash
curl -X GET 'https://docspack.dev/openapi.json'

JavaScript

js
const response = await fetch("https://docspack.dev/openapi.json", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/openapi.json",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/openapi.json", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.

example

A fictional API, served in both renderings so the two can be compared.


GET/api/example.json

The worked example's OpenAPI document.

A fictional invoicing API — bearer auth, request bodies, a DELETE, an error shape — kept so the reference at /api/example can demonstrate what this site’s own read-only API cannot. Point docspack build --openapi at this URL to see what it emits.

Authentication

No credential required.

Response

200The document.
json
{}

Request

cURL

bash
curl -X GET 'https://docspack.dev/api/example.json'

JavaScript

js
const response = await fetch("https://docspack.dev/api/example.json", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/api/example.json",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/api/example.json", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.


GET/api/example.lapis

The worked example in LAPIS.

The same document as /api/example.json, in the notation docspack answers with: every operation and every type in about a fifth of the tokens. The pair is here to be compared.

Authentication

No credential required.

Response

200The document as LAPIS.

Request

cURL

bash
curl -X GET 'https://docspack.dev/api/example.lapis'

JavaScript

js
const response = await fetch("https://docspack.dev/api/example.lapis", {
  method: "GET",
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

Python

python
import requests

response = requests.get(
    "https://docspack.dev/api/example.lapis",
)
response.raise_for_status()
data = response.json()

Go

go
req, err := http.NewRequest("GET", "https://docspack.dev/api/example.lapis", nil)
if err != nil {
	return err
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer resp.Body.Close()

Try it

The document's servers, or one of your own.

Generated from openapi.json by @docspack/sheaf-react. The first endpoint below is GET /llms.txt.

The same ranking docspack search uses, over the same 13 documents.