Build with AI

You can point an AI coding assistant — GitHub Copilot, Cursor, Claude, ChatGPT, or any tool that accepts an OpenAPI file — at Spectrum’s API and have it scaffold a working client for you. Everything the assistant needs is published in a single machine-readable spec.

What to give the AI

Resource URL
OpenAPI 3.1 spec (JSON) https://docs.spectrumcustomizer.com/api/openapi.json
AI quick-start index https://docs.spectrumcustomizer.com/llms.txt
Interactive reference API Reference

The OpenAPI spec is the important one: it describes every endpoint, request and response schema, and the authentication scheme. Most assistants can read it straight from the URL above, or you can download it and drop it into your project.

Want AI agents (Claude, Copilot, Cursor) to call the Spectrum API directly as tools instead of generating code? Use the MCP Server.

llms.txt is a short, AI-friendly index that links to the spec and the key reference pages, following the llms.txt convention. Paste its URL into a chat assistant to give it grounded context about Spectrum.

Authentication

Every request is authenticated with a single header:

SPECTRUM_API_TOKEN: <your-token>
  • The base URL is https://api.spectrumcustomizer.com (production) or https://staging.spectrumcustomizer.com (staging) — see Environments.
  • Ask your Spectrum account manager for a token if you don’t have one.
  • Treat the token like a password: keep it in an environment variable or secret store, and never paste it into a shared chat or commit it to source control.

When you prompt an AI assistant, tell it to read the token from an environment variable (for example SPECTRUM_API_TOKEN). Do not paste the real token into the prompt.

Copy-paste prompts

Use these as starting points. Replace the language/framework and endpoint to match what you’re building.

Scaffold a client from the spec

Here is the OpenAPI spec for the Spectrum Integration API:
https://docs.spectrumcustomizer.com/api/openapi.json

Generate a typed TypeScript client for it. Authentication is a single request
header, SPECTRUM_API_TOKEN, whose value must be read from
process.env.SPECTRUM_API_TOKEN — never hard-code it. Target the production
server https://api.spectrumcustomizer.com. Include a small example that calls
one read-only endpoint.

Build a specific integration

Using the Spectrum Integration API OpenAPI spec at
https://docs.spectrumcustomizer.com/api/openapi.json, write a Python script that
polls order status for a given client handle and prints any orders whose status
changed. Authenticate with the SPECTRUM_API_TOKEN header, read from an
environment variable. Handle HTTP 429 rate-limit responses with exponential
backoff.

Explain an endpoint before you code

From the Spectrum OpenAPI spec at
https://docs.spectrumcustomizer.com/api/openapi.json, explain the request body
and response for submitting an order acknowledgement. List required fields, their
types, and give one valid example request.

Generate code without an AI assistant

The interactive API Reference (powered by Scalar) can generate ready-to-run request snippets for each endpoint in many languages — cURL, JavaScript, Python, and more. Open an endpoint, fill in the parameters, and copy the sample. You can also generate a client directly from the spec with standard tooling such as openapi-generator or openapi-typescript.

Good practices

  • Ground the assistant in the spec. Always give it the openapi.json URL so it uses real endpoint and schema names instead of guessing.
  • Keep secrets out of prompts. Reference the token by environment-variable name only.
  • Respect rate limits. Some endpoints are rate limited per client — see Rate Limiting. Ask the assistant to add retry/backoff.
  • Verify against the reference. After the AI generates code, confirm request shapes against the API Reference.

Copyright ©2026 All rights reserved | Terms & Privacy