cd /news/developer-tools/generate-a-custom-openai-api-example… · home › topics › developer-tools › article
[ARTICLE · art-172115] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Generate a custom OpenAI API example without putting a key in your browser

CheapClankers released a browser-only API setup builder that generates Node.js, Python and Bash/cURL examples from an API base URL, optional model ID and output limit, without an API key field or any inference request. The tool validates URL shape—rejecting full operation paths, embedded credentials, query parameters and fragments—while preserving custom path prefixes, and its public fixture runs 13 checks against a loopback HTTP server using the real SDKs. The project cautions that the checks do not probe remote endpoints, prove API compatibility, or test streaming or live provider behavior.

key takeaway

Keep the API base URL separate from the operation path—a base like https://example.com/tenant/v1 should yield /tenant/v1/models—and list models before sending a non-streaming request with an explicit max_tokens, a 30-second timeout and retries disabled for the first integration check.

by read3 min views2 publishedNov 18, 2026

Disclosure: CheapClankers maintains the tool described here and operates a paid developer API service. This article was prepared with AI. The generated Node.js and Python programs were tested against a local mock API; those checks do not establish production model availability.

When switching an OpenAI SDK to another compatible endpoint, there are two separate questions:

A successful answer to the first question does not establish the second. To make the first request easier to inspect, we published a small browser-only API setup builder. It generates Node.js, Python and Bash/cURL examples from an API base URL, optional model ID and output limit.

There is no API key field. The page processes those settings locally and does not send an inference request. You run the generated code separately, with a key in your server-side environment.

For Chat Completions, an SDK normally combines an API base with an operation path:

Base:       https://api.example.com/v1
Discovery:  GET  https://api.example.com/v1/models
Generation: POST https://api.example.com/v1/chat/completions

Putting the complete /chat/completions URL into baseURL confuses those two layers. The builder rejects complete operation paths, credentials in the URL, query parameters and fragments. It permits HTTPS endpoints, plus HTTP on localhost for a local fixture.

It also preserves a custom path prefix. A base such as https://example.com/tenant/v1 should produce /tenant/v1/models, not silently discard /tenant.

This checks URL shape. It does not probe the remote endpoint or prove that another service implements the expected API.

The generated SDK scripts list models first and stop if the selected ID is absent. Then they send a non-streaming text request with an explicit max_tokens value. They use a 30-second timeout and disable automatic retries for the first integration check.

That is still not a universal compatibility test. A model appearing in discovery establishes access to that ID; check Chat Completions support separately. Other protocols, tools, images and model-specific token parameters need their own checks.

The cURL tab is a manual two-step example: inspect discovery before running the generation command. With no model ID entered, it leaves an explicit model placeholder to replace.

The public fixture runs the generated programs using the real Node.js and Python SDKs against a loopback HTTP server. Its 13 checks cover configuration rejection and six cases per SDK:

The assertions check the exact custom-prefix request paths and selected output limit. No paid inference is used. You can reproduce the checks after installing the pinned dependencies in the example repository:

node --test docs/verify.mjs

The SDK fixture does not execute the cURL template, and it does not test streaming or live provider behavior.

A timeout does not prove that a server did no work. Before repeating a generation, check usage and any available request status. A small output limit also does not cap every possible charge: input, reasoning and other billed usage depend on the provider and model.

The builder includes a status-code guide using CheapClankers' documented error meanings. Treat another provider's returned error and documentation as authoritative for that service.

For our endpoint, the API setup docs explain configuration and request IDs, and the model catalogue lists model IDs, supported protocols, rates and availability. The static builder's source is MIT licensed; the hosted API is a separate paid service.

The tool is intentionally a request-construction aid. Start with one small, understood request, then test the features your application actually needs.

── more in #developer-tools 4 stories · sorted by recency
── more on @cheapclankers 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/generate-a-custom-op…] indexed:0 read:3min 2026-11-18 · —