Open History to see the last commit
1# @modelschemas/client
2
3Typed fetch client for [modelschemas](https://modelschemas.com) — live
4per-endpoint request/response JSON Schemas and model metadata for AI
5providers (OpenAI, Anthropic, Gemini, xAI Grok, ElevenLabs, OpenRouter,
6FAL), generated from the service's OpenAPI spec.
7
8> Ships built ESM (`.js` + `.d.ts`). Node loads it with no TypeScript loader.
9
10```bash
11pnpm add @modelschemas/client
12```
13
14```ts
15import {
16 createModelschemasClient,
17 listModels,
18 getSchema,
19 validatePayload,
20} from '@modelschemas/client'
21
22const client = createModelschemasClient({
23 baseUrl: 'https://modelschemas.com',
24})
25
26const models = await listModels({ client, query: { activity: 'chat' } })
27const schema = await getSchema({
28 client,
29 path: { provider: 'anthropic', activity: 'chat', endpointId: 'v1/messages' },
30 query: { kind: 'input' },
31})
32```
33
34Schema responses are content-addressed (`contentHash` = ETag =
35`?version=` pin) and carry `provenance` (upstream `sourceUrl`,
36`sourceHash`, `fetchedAt`, `extractorVersion`) so every derivation is
37independently verifiable.
38
39Docs: [modelschemas.com/docs](https://modelschemas.com/docs) · API spec:
40[/openapi.json](https://modelschemas.com/openapi.json) · Source:
41[github.com/TanStack/modelschemas](https://github.com/TanStack/modelschemas)