Under heavy development
StitchAPI

Author from one example

Have an agent emit a stitch declaration from a single curl, HAR, or doc snippet.

An agent can write a complete stitch from one example — a curl, a HAR entry, a doc snippet — because a stitch is declarative and atomic: it needs only a URL and one example, never an OpenAPI spec and never codegen. The agent reads the example, maps its parts onto the authoring surface, and emits a stitch({...}) declaration — the same surface a human writes by hand.

Example

Give the agent a single curl:

curl https://api.example.com/users/1

It emits the stitch that example describes:

import {  } from 'stitchapi';

const  = ({
    : 'https://api.example.com',
    : '/users/{id}',
    : 'GET',
});

await ({ : { : 1 } });

That declaration is the whole integration — no spec to ingest, no generated code to commit.

Options

The agent maps each part of the one example onto a config field:

  • URL → baseUrl + path. The origin becomes baseUrl; the rest becomes path, with concrete segments lifted into {param} slots (so /users/1 becomes /users/{id}, called with { params: { id: 1 } }).
  • Headers → auth / headers. An Authorization: Bearer … or x-api-key header becomes an auth strategy resolved at call time; other headers become static headers.
  • An example response → an output schema. When the example carries a response body, the agent can add an output schema — turning one move into TypeScript types, runtime validation, and drift detection.

This works because a stitch is atomic, not spec-first — no OpenAPI document, no codegen step. And what the agent emits is the normal authoring surface: a plain stitch({...}) declaration, identical to a hand-written one, that you can read, review, and extend.

The emitted stitch({...}) is the same call documented in stitch() — add an output schema with validation exactly as you would for a hand-authored stitch.

See also

On this page