Skip to content

feat: add OrcaRouter as a first-class OpenAI-compatible client - #1097

Open
dulcestentaciones2920-debug wants to merge 1 commit into
digitalocean:mainfrom
dulcestentaciones2920-debug:feat/orcarouter-provider
Open

feat: add OrcaRouter as a first-class OpenAI-compatible client#1097
dulcestentaciones2920-debug wants to merge 1 commit into
digitalocean:mainfrom
dulcestentaciones2920-debug:feat/orcarouter-provider

Conversation

@dulcestentaciones2920-debug

Copy link
Copy Markdown

Add NewOrcaRouterClient, a first-class client for OrcaRouter that lets godo users drive OrcaRouter's OpenAI-compatible gateway through the same Chat, Messages, Models, Embeddings, and Responses services they already use against the Serverless Inference API — without pointing a DigitalOcean client at an anonymous base URL.

OrcaRouter is an OpenAI-compatible AI gateway built for both models and agents. Like OpenRouter, it exposes a provider/model namespace across many models — but it also combines adaptive routing, automatic failover, zero-markup inference, observability, guardrails, and agent-tool governance behind the same endpoint. Adding orcarouter as a named client means this project's users can use that stack directly, without treating OrcaRouter as an anonymous custom base URL. It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes.

This mirrors the existing NewAgentInferenceClient pattern: a standalone constructor that builds an authenticated *Client and points the shared inference services at OrcaRouter's endpoint. The inference-service wiring in NewClient is factored into newInferenceServices so both DigitalOcean's Serverless Inference API and OrcaRouter resolve through the same code path.

Changes:

  • orcarouter.go: OrcaRouterClient + NewOrcaRouterClient(apiKey string, opts ...ClientOpt); accepts the same ClientOpt values as the rest of godo (e.g. WithRetryAndBackoffs, SetBaseURL for self-hosted instances).
  • serverless_inference.go: extract newInferenceServices helper.
  • godo.go: NewClient uses the helper; no behavior change.
  • orcarouter_test.go: httptest coverage for non-streaming/streaming chat completions and model listing.

Verified locally with go build ./..., go vet ./..., go test ./... (all green), plus a live 200 against OrcaRouter's real endpoint using NewOrcaRouterClient.

Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter

I'm an engineer on the OrcaRouter team.

Add NewOrcaRouterClient, which embeds godo.Client and resolves the shared
inference services (Chat, Messages, Models, Embeddings, Responses) against
OrcaRouter's OpenAI-compatible gateway endpoint at api.orcarouter.ai.

The inference-service wiring in NewClient is factored into newInferenceServices
so the same services can be pointed at OrcaRouter without treating it as an
anonymous custom base URL.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant