HomeSDK

SDK

Keep the client your team already uses.

Octoryn is designed for OpenAI SDKs and other clients that support a compatible base URL. You do not need an Octoryn-specific package to begin, and this guide does not claim a proprietary SDK has been published.

01PythonOpenAI client compatibility
02TypeScriptOpenAI client compatibility
03HTTPDirect compatible integration
01

Configure, do not rewrite.

Set the compatible client base URL to https://api.octoryn.dev/v1 and supply the environment-specific API key. Keep the rest of the client lifecycle in the application.

  • Use the OpenAI SDK version already approved by your teamExpand details

    This is part of Configure, do not rewrite.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
  • Load the API key from a protected runtime environmentExpand details

    This is part of Configure, do not rewrite.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
  • Keep network timeouts under application controlExpand details

    This is part of Configure, do not rewrite.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
02

Use the same pattern in Python.

Python services can configure the official OpenAI client with the Octoryn base URL and credential. Request fields still need to match the selected route's supported capabilities.

  • Create one appropriately scoped client per application lifecycleExpand details

    This is part of Use the same pattern in Python.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
  • Pass an eligible model or stable policy aliasExpand details

    This is part of Use the same pattern in Python.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
  • Close or reuse network resources according to the client guidanceExpand details

    This is part of Use the same pattern in Python.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
03

Use the same pattern in TypeScript.

Server-side TypeScript services can configure the OpenAI client in compatible mode. Keep Router credentials on the server and do not expose them through client-side application code.

  • Instantiate the client in a trusted server runtimeExpand details

    This is part of Use the same pattern in TypeScript.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
  • Avoid shipping API keys in browser JavaScriptExpand details

    This is part of Use the same pattern in TypeScript.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
  • Handle cancellation and timeouts with the surrounding runtimeExpand details

    This is part of Use the same pattern in TypeScript.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
04

Integrate directly over HTTP when needed.

A compatible HTTP integration is appropriate for services that cannot use an OpenAI SDK. Match the authenticated JSON contract and implement streaming parsing only when the route and client both support it.

  • Send bearer-token authentication over TLSExpand details

    This is part of Integrate directly over HTTP when needed.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
  • Set explicit content types and request deadlinesExpand details

    This is part of Integrate directly over HTTP when needed.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
  • Parse streaming events incrementally rather than as one JSON documentExpand details

    This is part of Integrate directly over HTTP when needed.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
05

Pin and test the client boundary.

Treat client library upgrades as application changes. Pin versions where your delivery process requires reproducibility, and test compatibility, streaming and error paths before rollout.

  • Exercise a non-streaming request in CI or pre-productionExpand details

    This is part of Pin and test the client boundary.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
  • Test cancellation, timeouts and rate-limit handlingExpand details

    This is part of Pin and test the client boundary.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs
  • Review upstream SDK release notes before upgradesExpand details

    This is part of Pin and test the client boundary.. Octoryn keeps its configuration, outcome and routing context together so teams can validate and review the capability independently.

    View implementation docs

OCTORYN ROUTER

Check the complete integration contract.

Use the API reference alongside your chosen SDK and verify route capability support before production rollout.

Read the API reference