feat: add OrcaRouter as a first-class OpenAI-compatible client - #1097
Open
dulcestentaciones2920-debug wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
NewOrcaRouterClient, a first-class client for OrcaRouter that lets godo users drive OrcaRouter's OpenAI-compatible gateway through the sameChat,Messages,Models,Embeddings, andResponsesservices 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
orcarouteras 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
NewAgentInferenceClientpattern: a standalone constructor that builds an authenticated*Clientand points the shared inference services at OrcaRouter's endpoint. The inference-service wiring inNewClientis factored intonewInferenceServicesso 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 sameClientOptvalues as the rest of godo (e.g.WithRetryAndBackoffs,SetBaseURLfor self-hosted instances).serverless_inference.go: extractnewInferenceServiceshelper.godo.go:NewClientuses 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 live200against OrcaRouter's real endpoint usingNewOrcaRouterClient.Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter
I'm an engineer on the OrcaRouter team.