Copy-paste examples for using one OpenAI-compatible base_url across Cursor, Claude Code, Codex CLI, Aider, OpenHands, Flowise, LangChain, LlamaIndex, GitHub Actions, Node.js, Python, Go, Rust, Deno, and curl.
These examples use API NODE by default:
Base URL: https://apinode.pro/v1
Model: gpt-5.5
API: OpenAI-compatible Chat Completions / Responses API
Use this repo when you want to:
- keep your app independent from one upstream provider;
- configure coding tools with a custom OpenAI-compatible endpoint;
- centralize API keys, quota, usage logs, and model/provider switching;
- reproduce API smoke tests in CI before changing your production app.
Need trial credits? Open a Request trial credits issue and include your use case.
export APINODE_API_KEY="your_api_key"
export APINODE_BASE_URL="https://apinode.pro/v1"
export APINODE_MODEL="gpt-5.5"Then choose an example:
examples/curl
examples/node
examples/python
examples/cursor
examples/codex-cli
examples/claude-code
examples/github-actions
If you are choosing between SDKs, coding agents, and troubleshooting docs, start with template and agent entrypoints.
If you cloned this repository and want the shortest path, start with after cloning this repo.
Developers often want to test a new LLM provider or gateway without rewriting an app. Most modern AI tools and SDKs can use a custom OpenAI-compatible endpoint.
This repo keeps those setup paths small, explicit, and easy to verify.
cd examples/curl
export APINODE_API_KEY="your_api_key"
export APINODE_BASE_URL="https://apinode.pro/v1"
export APINODE_MODEL="gpt-5.5"
curl "$APINODE_BASE_URL/chat/completions" \
-H "Authorization: Bearer $APINODE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [{"role": "user", "content": "Say hello from API NODE"}]
}'cd examples/node
npm install
export APINODE_API_KEY="your_api_key"
export APINODE_BASE_URL="https://apinode.pro/v1"
export APINODE_MODEL="gpt-5.5"
npm startcd examples/python
python3 -m pip install -r requirements.txt
export APINODE_API_KEY="your_api_key"
export APINODE_BASE_URL="https://apinode.pro/v1"
export APINODE_MODEL="gpt-5.5"
python3 main.pySee:
examples/codex-cli/config.toml
The Codex CLI example uses:
[model_providers.OpenAI]
base_url = "https://apinode.pro/v1"
wire_api = "responses"
requires_openai_auth = true- How to use one OpenAI-compatible base URL for GPT, Claude, Gemini, and coding agents
- Configure Cursor with an OpenAI-compatible API gateway
- Cursor configuration mistakes with OpenAI-compatible gateways
- Use Codex CLI with API NODE
- Use Aider with API NODE
- Use OpenHands with API NODE
- Building reliable LLM fallback with an OpenAI-compatible gateway
- Use LiteLLM with API NODE
- LiteLLM OpenAI-compatible base URL quickstart
- LiteLLM custom headers for OpenAI-compatible endpoints
- Use Vercel AI SDK with API NODE
- Next.js route handler with API NODE
- Use LangChain JS with API NODE
- Use LangGraph Python with API NODE
- Use LlamaIndex Python with API NODE
- Call API NODE with fetch
- Use the Python OpenAI SDK Responses API with API NODE
- Call the Responses API from Go with API NODE
- Call the Responses API from Rust with API NODE
- Call the Responses API from Deno with API NODE
- Test API NODE in a GitHub Actions matrix
- Use ruby-openai with API NODE
- Use Continue with API NODE
- Use Cline with API NODE
- Use Roo Code with API NODE
- Use Open WebUI with API NODE
- Use LibreChat with API NODE
- Use Flowise with API NODE
- OpenAI-compatible environment variable patterns
- Endpoint readiness checklist
- Base URL path joining rules
- Custom OpenAI base URL vs Chat Completions endpoint
- Azure AI Foundry OpenAI-compatible v1 endpoint notes
- Azure AI Foundry OpenAI-compatible maintainer case study
- App maintainer checklist for custom OpenAI-compatible providers
- Provider abstraction for custom OpenAI-compatible endpoints
- OpenAI-compatible embeddings endpoint checklist
- OpenAI-compatible embeddings troubleshooting index
- Separate chat and embeddings endpoints
- Custom OpenAI endpoint issue triage checklist
- Browser CORS and custom OpenAI-compatible endpoints
- Provider-specific request parameters
- Token limit parameter compatibility
- Reasoning model output budget notes
- OpenAI-compatible request regression tests
- Gateway latency and error baseline template
- Maintainer regression test for custom OpenAI endpoints
- Maintainer-ready docs PR for an OpenAI-compatible provider
- Direct triage comments for custom endpoint issues
- OpenAI SDK custom base URL examples
- Base URL regression test fixtures
- Agent base URL configuration examples
- Codex provider block reference
- Choose the right OpenAI-compatible base URL
- Template and agent entrypoints
- After cloning this repo
- Troubleshoot 401 invalid API key
- Troubleshoot 404 base URL issues
- Troubleshoot model not found
- Troubleshoot custom OpenAI endpoint configuration
- Troubleshoot runtime config not applied
- Troubleshoot an endpoint routed to the wrong provider
- Troubleshoot Azure OpenAI-compatible v1 api-version errors
- Troubleshoot max_tokens vs max_completion_tokens
- Troubleshoot embeddings encoding_format null errors
- Troubleshoot Responses API vs Chat Completions
- Troubleshoot streaming output
- Need trial credits? Open a Request trial credits issue with your tool, current problem, expected usage, and first test.
- Open an issue to request a new integration guide, report a compatibility issue, or share a working redacted config.
- Use Discussions for questions, guide ideas, and community config notes. See DISCUSSIONS.md.
Copy this workflow into .github/workflows/api-smoke-test.yml:
examples/github-actions/api-smoke-test.yml
Add APINODE_API_KEY as a repository secret, then run the workflow manually or on schedule.
Suggested GitHub topics:
ai-gateway
openai-compatible
openai-api
responses-api
llm-api
llm-gateway
api-gateway
ai-api
claude-code
codex-cli
cursor
aider
openai
model-router
developer-tools
github-actions
langchain
llamaindex
Useful additions:
- More SDK recipes for popular OpenAI-compatible clients.
- More coding-agent and chat-app configuration examples.
- CI smoke tests for additional languages and package managers.
- Short troubleshooting notes for common base URL, model, and streaming issues.
Please do not commit API keys or account secrets.