Let an assistant write the integration, from the real contract.
A coding assistant guesses field names when it has not read the API. Give it one of the files below and it works from the same contract this documentation is generated from.
The files
| File | What it holds |
|---|---|
/llms.txt | Index of every docs page, guide and developer docs, each with a one-line description. |
/docs/api/llms-full.txt | The whole developer documentation as one Markdown file: contract, quickstart, basics, recipes and the full reference. |
/docs/llms-full.txt | The whole app guide as one Markdown file, for integrations that also set things up in the app. |
/api/openapi.json | OpenAPI 3.1, every route of the public API. The same as YAML: /api/openapi.yaml. |
/api/webhook-test-vectors.json | Signed webhook bodies with their expected signatures, to test a receiver. |
Every docs page also exists as Markdown: add .md to its address,
for example /docs/api/quickstart.md.
"Copy page" at the top of each page puts that Markdown on the clipboard.
Which one to give it
- The assistant can fetch URLs: point it at
https://upfour.io/llms.txtand let it open the pages it needs. - It works from pasted context: paste
/docs/api/llms-full.txtonce, or only the Markdown of the pages for the task, such as quickstart, keys and scopes, and the reference page of the resource. - It generates a client or types: give it
/api/openapi.json.
What the OpenAPI file adds
Besides paths, parameters and scopes, the operations carry two up4 extensions:
x-up4-example: a request and the response it produced, recorded from a run of the real API and anonymised, so field names and shapes are the ones the API returns. Nearly every operation has one.x-up4-error-codes: the error codes this operation can return. Codes every operation can return, such asunauthorizedorrate_limit_exceeded, are listed once at the top inx-up4-error-codes-every-operation. What each code means and how to fix it: errors.
A prompt that works
Read https://upfour.io/llms.txt and the pages it links for the up4 API.
Write a script that creates an HTTP monitor for every URL in urls.txt.
Use only fields from the OpenAPI spec at https://upfour.io/api/openapi.json.
Read the API key from the UP4_API_KEY environment variable, send an
Idempotency-Key with every POST, and stop on the first error response,
printing its code and message.Keys and safety
- Never paste an API key into a chat. Let the generated code read it from an environment variable, as above.
- Give the key only the scopes the script needs; a read-only key cannot change anything. See API keys and scopes.
- Review a generated script before it runs against your Company. Writes take effect at once.
Was this page helpful?