Skip to content

apinode-pro/openai-compatible-ai-gateway-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI-Compatible AI Gateway Examples for Cursor, Claude Code, Codex, SDKs, and CI

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.

Try API NODE

Quickstart

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.

Why This Repo Exists

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.

Examples

curl

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"}]
  }'

Node.js

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 start

Python

cd 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.py

Codex CLI

See:

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

Guides

Troubleshooting

Requests, trial credits, and working configs

  • 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.

GitHub Actions Smoke Test

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.

Repository Topics

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

Contributing

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.

Notes

Releases

No releases published

Packages

 
 
 

Contributors