Spec
2 operations (GET): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.
1 min read
Base URL: https://api.codespar.dev
None of the operations below takes a credential: the published document declares them open. See Authentication for the rest of the API.
GET /openapi.json
GET
https://api.codespar.dev/openapi.jsonNo credential
This document
Built once per boot from static Zod definitions, identical for every caller, and served with no credential — which is the whole point of ent#964. /v1/openapi.json returns the same bytes.
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
Example request
curl -X GET https://api.codespar.dev/openapi.json \
-H "Authorization: Bearer $CODESPAR_API_KEY"GET /openapi.json HTTP/1.1
Host: api.codespar.dev
Authorization: Bearer $CODESPAR_API_KEYimport os
import requests
res = requests.get(
"https://api.codespar.dev/openapi.json",
headers={"Authorization": f"Bearer {os.environ['CODESPAR_API_KEY']}"},
)
res.raise_for_status()
data = res.json()const res = await fetch("https://api.codespar.dev/openapi.json", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
},
});
const data = await res.json();const result = await cs.api.get("/openapi.json");GET /v1/openapi.json
GET
https://api.codespar.dev/v1/openapi.jsonNo credential
This document, under the /v1 mount
Identical to /openapi.json. Both mounts exist because a generator, a crawler or a reader will try either.
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
Example request
curl -X GET https://api.codespar.dev/v1/openapi.json \
-H "Authorization: Bearer $CODESPAR_API_KEY"GET /v1/openapi.json HTTP/1.1
Host: api.codespar.dev
Authorization: Bearer $CODESPAR_API_KEYimport os
import requests
res = requests.get(
"https://api.codespar.dev/v1/openapi.json",
headers={"Authorization": f"Bearer {os.environ['CODESPAR_API_KEY']}"},
)
res.raise_for_status()
data = res.json()const res = await fetch("https://api.codespar.dev/v1/openapi.json", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
},
});
const data = await res.json();const result = await cs.api.get("/v1/openapi.json");