Skip to main content

OpenAI SDK Guides

Choose the runtime guide for the official OpenAI SDK with GonkaGate.

Choose the runtime guide for the official OpenAI SDK after you have one working GonkaGate request. If you use LangChain, Vercel AI SDK, Aider, Cline, Roo Code, or another wrapper or community tool, use Framework & Tool Guides instead. If you use Claude Code, Cursor, Kilo Code, OpenCode, or OpenClaw, use the dedicated Claude Code, Cursor, Kilo Code, OpenCode, or OpenClaw page instead.

Shared OpenAI SDK shape

Request Example
client = OpenAI-compatible SDK client
base_url / baseURL = "https://api.gonkagate.com/v1"
api_key = "gp-your-api-key"

response = client.chat.completions.create(
  model = "current GonkaGate model ID",
  messages = [...]
)

Expected result: keep the same chat.completions.create(...) request shape in Python, TypeScript, Go, .NET, or Java. Only client setup and runtime-specific ergonomics change.

Before you open a runtime guide

  • One successful GonkaGate request or migration smoke test
  • A saved gp-... API key that your app can read from a secret store or environment variable
  • A current GonkaGate model ID for the workload you are integrating
  • A server-side place to keep the key out of browsers and public bundles

Choose a runtime guide

  • Python SDK: backend services, jobs, and scripts with sync or async clients.
  • TypeScript SDK: Node.js, Deno, Bun, and edge-friendly runtimes.
  • Go SDK: context.Context, explicit timeouts, and service-level client reuse.
  • .NET SDK: Betalgo.OpenAI with DI-friendly client setup.
  • Java SDK: openai-java with explicit client configuration.

Common SDK errors and compatibility notes

  • 401 invalid_api_key usually means the key is missing, malformed, or unavailable in the runtime where the SDK runs.
  • 404 model_not_found usually means the SDK setup is fine but the model ID is stale.
  • 429 insufficient_quota means the prepaid USD balance is too low for the request.
  • If your app narrows usage, allow additive GonkaGate cost fields such as base_cost_usd, platform_fee_usd, and total_cost_usd.

See also

Was this page helpful?