Skip to content

Generate type-safe SDKs for your API

Octri generates type-safe, production-ready client libraries in TypeScript, Python, Go, Java, Kotlin, Ruby, PHP, Rust, Swift and Dart that read as if they were hand-written in each language, then publishes them and opens a pull request whenever your API changes.

Start from scratch

or upload a file · OpenAPI 3.0 and 3.1, Swagger 2.0, Postman, AsyncAPI

index.ts
import { Acme } from "acme";

async function main() {
  const client = new Acme({
    // Optional: replaces the default server and any server an operation declares.
    baseUrl: "https://api.acme.com",
    auth: { bearer: process.env.API_TOKEN! },
  });
  const result = await client.invoices.create({ amount: 100, currency: "currency" });
  console.log(result);
}

main().catch(console.error);
main.py
import os

from acme import ClientConfig, ClientAuthConfig, Acme

config = ClientConfig(
    # Optional: replaces the default server and any server an operation declares.
    base_url="https://api.acme.com",
    auth=ClientAuthConfig(bearer=os.environ["API_TOKEN"]),
)
client = Acme(config)
result = client.invoices.create(amount=100, currency="currency")
print(result)
main.go
package main

import (
	"context"
	"fmt"
	"os"

	sdk "github.com/acme/sdk"
)

func main() {
	ctx := context.Background()
	config := sdk.ClientConfig{
		BaseURL: "https://api.acme.com",
		Auth: &sdk.ClientAuthConfig{Bearer: os.Getenv("API_TOKEN")},
	}
	sdk.Configure(&config)
	result, err := sdk.StreamEvents(ctx, config)
	if err != nil {
		panic(err)
	}
	fmt.Printf("%+v\n", result)
}
Main.java
import acme.*;
import acme.methods.Invoices;

public final class Example {
    public static void main(String[] args) throws Exception {
        var config = new SdkConfig.ClientConfig();
        // Optional: replaces the default server and any server an operation declares.
        config.baseUrl = "https://api.acme.com";
        var auth = new SdkConfig.ClientAuthConfig();
        auth.bearer = System.getenv("API_TOKEN");
        config.auth = auth;
        var client = new Acme(config);
        var result = client.invoices.create(Invoices.CreateInvoiceRequest.builder().amount(100L).currency("currency").build());
        System.out.println(result);
    }
}
main.dart
import 'dart:io';

import 'package:acme/acme.dart';

Future<void> main() async {
  final config = ClientConfig(
    // Optional: replaces the default server and any server an operation declares.
    baseUrl: "https://api.acme.com",
    auth: ClientAuthConfig(bearer: Platform.environment['API_TOKEN']!),
  );
  final client = Acme(config);
  final result = await client.invoices.create(amount: 100, currency: 'currency');
  print(result);
}
main.rb
require "acme"

config = Acme::ClientConfig.new
# Optional: replaces the default server and any server an operation declares.
config.base_url = "https://api.acme.com"
auth = Acme::ClientAuthConfig.new
auth.bearer = ENV.fetch("API_TOKEN")
config.auth = auth
client = Acme::Acme.new(config)
result = client.invoices.create(amount: 100, currency: "currency")
p result
index.php
<?php

require __DIR__ . '/vendor/autoload.php';

use acme\ClientConfig;
use acme\SdkConfig;
use acme\ClientAuthConfig;
use acme\Acme;

$config = new ClientConfig();
// Optional: replaces the default server and any server an operation declares.
$config->baseUrl = "https://api.acme.com";
$auth = new ClientAuthConfig();
$auth->bearer = getenv('API_TOKEN') ?: throw new RuntimeException('API_TOKEN is required');
$config->auth = $auth;
$client = new Acme($config);
$result = $client->invoices->create(amount: 100, currency: "currency");
var_dump($result);
main.rs
use acme::{ClientConfig, ClientAuthConfig, Acme};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = ClientConfig {
        // Optional: replaces the default server and any server an operation declares.
        base_url: Some("https://api.acme.com".to_string()),
        auth: Some(ClientAuthConfig { bearer: Some(std::env::var("API_TOKEN")?), ..Default::default() }),
        ..Default::default()
    };
    let client = Acme::new(config);
    let result = client.invoices.create(100, "currency".to_string(), None)?;
    println!("{result:#?}");
    Ok(())
}
main.swift
import Foundation
import Acme

@main
struct Example {
    static func main() async throws {
        let config = ClientConfig(
            // Optional: replaces the default server and any server an operation declares.
            baseUrl: "https://api.acme.com",
            auth: ClientAuthConfig(bearer: ProcessInfo.processInfo.environment["API_TOKEN"]!)
        )
        let client = Acme(config: config)
        let result = try await client.invoices.create(amount: 100, currency: "currency")
        print(result)
    }
}
Main.kt
import acme.*

fun main() {
    val config = ClientConfig(
        // Optional: replaces the default server and any server an operation declares.
        baseUrl = "https://api.acme.com",
        auth = ClientAuthConfig(bearer = System.getenv("API_TOKEN")),
    )
    val client = Acme(config)
    val result = client.invoices.create(amount = 100, currency = "currency")
    println(result)
}
ExamplesSDK examples

SDK examples for APIs you already know

SDKs Octri generated for well-known public APIs. Pick an API, then a language, and read the code your users would install.

OpenAI

Responses, chat completions, embeddings, files, fine-tuning and evals.

Operations
360
Languages
10
index.tsRepository
import { OpenAI } from "@octridev/openai";

async function main() {
  const client = new OpenAI({
    // Optional: replaces the default server and any server an operation declares.
    baseUrl: "https://api.openai.com/v1",
    auth: { apiKeyAuth: process.env.OPENAI_API_KEY! },
  });
  const result = await client.models.list();
  console.log(result);
}

main().catch(console.error);
main.pyRepository
import os

from octridev_openai import ClientConfig, ClientAuthConfig, OpenAI

config = ClientConfig(
    # Optional: replaces the default server and any server an operation declares.
    base_url="https://api.openai.com/v1",
    auth=ClientAuthConfig(api_key_auth=os.environ["OPENAI_API_KEY"]),
)
client = OpenAI(config)
result = client.models.list()
print(result)
main.goRepository
package main

import (
	"context"
	"fmt"
	"os"

	sdk "github.com/OctriDev/openai-go-showcase-sdk"
)

func main() {
	ctx := context.Background()
	config := sdk.ClientConfig{
		// Optional: replaces the default server and any server an operation declares.
		BaseURL: "https://api.openai.com/v1",
		Auth: &sdk.ClientAuthConfig{ApiKeyAuth: os.Getenv("OPENAI_API_KEY")},
	}
	client := sdk.NewOpenAI(config)
	result, err := client.Models.List(ctx)
	if err != nil {
		panic(err)
	}
	fmt.Printf("%d data\n", len(result.Data))
}
Main.javaRepository
import dev.octri.showcase.openai.*;

public final class Example {
    public static void main(String[] args) throws Exception {
        var config = new SdkConfig.ClientConfig();
        // Optional: replaces the default server and any server an operation declares.
        config.baseUrl = "https://api.openai.com/v1";
        var auth = new SdkConfig.ClientAuthConfig();
        auth.apiKeyAuth = System.getenv("OPENAI_API_KEY");
        config.auth = auth;
        var client = new OpenAI(config);
        var result = client.models.list();
        System.out.println(result);
    }
}
main.dartRepository
import 'dart:io';

import 'package:octridev_openai/octridev_openai.dart';

Future<void> main() async {
  final config = ClientConfig(
    // Optional: replaces the default server and any server an operation declares.
    baseUrl: "https://api.openai.com/v1",
    auth: ClientAuthConfig(apiKeyAuth: Platform.environment['OPENAI_API_KEY']!),
  );
  final client = OpenAI(config);
  final result = await client.models.list();
  print(result);
}
main.rbRepository
require "octridev_openai"

config = OctridevOpenai::ClientConfig.new
# Optional: replaces the default server and any server an operation declares.
config.base_url = "https://api.openai.com/v1"
auth = OctridevOpenai::ClientAuthConfig.new
auth.api_key_auth = ENV.fetch("OPENAI_API_KEY")
config.auth = auth
client = OctridevOpenai::OpenAI.new(config)
result = client.models.list()
p result
index.phpRepository
<?php

require __DIR__ . '/vendor/autoload.php';

use octridev_openai\ClientConfig;
use octridev_openai\SdkConfig;
use octridev_openai\ClientAuthConfig;
use octridev_openai\OpenAI;

$config = new ClientConfig();
// Optional: replaces the default server and any server an operation declares.
$config->baseUrl = "https://api.openai.com/v1";
$auth = new ClientAuthConfig();
$auth->apiKeyAuth = getenv('OPENAI_API_KEY') ?: throw new RuntimeException('OPENAI_API_KEY is required');
$config->auth = $auth;
$client = new OpenAI($config);
$result = $client->models->list();
var_dump($result);
main.rsRepository
use octridev_openai::{ClientConfig, ClientAuthConfig, OpenAI};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = ClientConfig {
        // Optional: replaces the default server and any server an operation declares.
        base_url: Some("https://api.openai.com/v1".to_string()),
        auth: Some(ClientAuthConfig { api_key_auth: Some(std::env::var("OPENAI_API_KEY")?), ..Default::default() }),
        ..Default::default()
    };
    let client = OpenAI::new(config);
    let result = client.models.list(None)?;
    println!("{result:#?}");
    Ok(())
}
main.swiftRepository
import Foundation
import OctriDevOpenAI

@main
struct Example {
    static func main() async throws {
        let config = ClientConfig(
            // Optional: replaces the default server and any server an operation declares.
            baseUrl: "https://api.openai.com/v1",
            auth: ClientAuthConfig(apiKeyAuth: ProcessInfo.processInfo.environment["OPENAI_API_KEY"]!)
        )
        let client = OpenAI(config: config)
        let result = try await client.models.list()
        print(result)
    }
}
Main.ktRepository
import dev.octri.showcase.openai.*

fun main() {
    val config = ClientConfig(
        // Optional: replaces the default server and any server an operation declares.
        baseUrl = "https://api.openai.com/v1",
        auth = ClientAuthConfig(apiKeyAuth = System.getenv("OPENAI_API_KEY")),
    )
    val client = OpenAI(config)
    val result = client.models.list()
    println(result)
}

Built from each company’s public OpenAPI spec. None of them is an Octri customer or endorses Octri.

How it worksSDK generation

From your API to a published package

Connect your API once. Octri generates the SDKs, you shape them in SDK Studio, and every release publishes to the registries you link.

Spec

Bring your spec

Upload an OpenAPI file, or connect the repository it lives in.

Languages

Pick languages

Any of ten, each under the package name you choose.

Studio

Customize the client

Method names, grouping and layout in SDK Studio with a live preview, plus your own code in hooks.

Release

Publish

To npm, PyPI, Maven Central, crates.io and the rest, under your account.

Every change

Keep it current

Each spec change arrives as a pull request in every SDK repository, versioned by semver.

In every SDKType-safe client libraries

Every client ships with the parts that take longest

Pagination, streaming, typed errors, retries and webhook signatures, the parts that take longest to write by hand. The examples are TypeScript, and every language gets the same features on every plan. Read the generated SDKs for ten public APIs

Pagination

A lazy iterator over every item, following the cursor, offset, page or next-URL contract in your spec.

const invoices = client.invoices.list();

for await (const invoice of invoices) {
  console.log(invoice.id, invoice.status);
}

Streaming

Server-sent events as an async iterator, with keep-alives and the end-of-stream marker handled.

const events = client.events.stream();

for await (const event of events) {
  console.log(event.type);
}

Typed errors

A class for each common status, carrying the status, body, headers and request ID.

try {
  await client.invoices.create(invoice);
} catch (err) {
  if (err instanceof SdkRateLimitError) {
    console.log(err.requestId);
  }
}

Retries and idempotency

Retries on 408, 425, 429 and 5xx with backoff, and an idempotency key on every POST and PATCH.

await client.invoices.create(invoice, {
  idempotencyKey: "order-1042",
  retry: { maxAttempts: 5 },
  timeoutMs: 10_000,
});

Webhook signatures

Standard Webhooks verification, with rotating secrets and a timestamp window.

import { verifyWebhook } from "acme";

await verifyWebhook(
  rawBody,
  request.headers,
  process.env.ACME_WEBHOOK_SECRET!,
);

A CLI for your API

One command per operation, flags from its parameters, JSON out. Switch it on in SDK Studio.

export ACME_BASE_URL=https://api.acme.com

acme-cli list-invoices --limit 20
acme-cli create-invoice \
  --amount 4200 --currency usd
  • Typed models for every request and response
  • Auth read from your security schemes
  • Doc comments on every method, for editors and agents
  • File uploads typed from your spec, from a File or a Blob
LanguagesTen SDK languages

An SDK generator for every language your users write

Each SDK follows its own language's naming, uses its usual HTTP client and publishes to its usual registry. Every language gets the same features, and each one has its own page.

READMESDK documentation

The README comes written

Every SDK ships with a README for its language, from installation and auth to errors and pagination, and it updates whenever your API does. This is the top of the one for a TypeScript SDK.

README.md

Every README covers

  • Installation
  • Quickstart
  • Authentication
  • Client behavior
  • Errors and response metadata
  • Pagination
  • Streaming
  • Project layout and API discovery
  • Local mock-server tests
  • One per languageWritten in each SDK’s own idiom, never translated from another.
  • Docs inside the packageDoc comments on every method, for editors and coding agents.
  • A manifest of everythingEvery operation and model in sdk-manifest.json, for tools that index the SDK.

Acme API TypeScript SDK

A typed client library generated from the OpenAPI specification.

Package acme · Version 1.0.0 · 4 operations

Installation

npm install [email protected]

Authentication

Keep credentials outside source control. The quickstart reads them from the environment and the client sends each one only on the operations whose security requirement accepts its scheme.

SchemeClientAuth fieldSent as
SDK Studio bearer tokenbearerAuthorization: Bearer <token>
bearerAuthbearerAuthAuthorization: Bearer …

Client behavior

  • Base URL: https://api.acme.com.
  • Transport: Fetch API.
  • Timeout: 30,000 ms per attempt.
  • Retries: up to 3 attempts for status codes 408, 425, 429, 500, 502, 503, 504, with 500-8,000 ms backoff.
  • Idempotency: enabled for POST, PATCH using Idempotency-Key.

Errors and response metadata

All failure paths use a small, predictable hierarchy:

ErrorMeaning
SdkValidationErrorA request argument failed an OpenAPI constraint before network I/O.
SdkHttpErrorThe server returned a non-2xx response.
SdkApiErrorA 2xx response whose error envelope, when the API declares one, reports a failed call.
SdkResponseDecodeErrorA 2xx response body or stream event did not decode into its declared type.
SdkNetworkErrorDNS, connection, TLS, or socket failure.
SdkTimeoutErrorThe configured per-attempt timeout elapsed.
CustomizationSDK Studio

Fully customizable SDKs, down to a single endpoint

Change naming, structure and behavior for the whole project, one language or a single endpoint, and add your own code that survives every regeneration. None of it means editing your API.

Shape

Client style
FunctionsClass
Grouping
NoneTagsPath
Method names
ShortFull
Arguments
ObjectPositional
Folders
FlatBy tagBy path

Behavior

Timeout
30,000 ms
Unknown enums
OpenStrict
Sync methods
IncludeOmit
File header
IncludeOmit
CLI
OnOff

Per language

TypeScript
fetchaxios
Python
pydanticdataclass
Kotlin
OkHttpKtor
Package names
SharedPer language
Repositories
SharedPer language

Set once for the project, then override per language or per endpoint

Custom code in hooks, kept through every regeneration

Tested by defaultSDK tests and mock server

Tested before it ships, with a mock server in every repo

Every SDK repository comes with a mock server, contract tests and a GitHub Actions workflow that runs them alongside the unit tests on every pull request. It is included on every plan.

Contract suiteAll passing

  • client.invoices.list()GET /invoicesPassed
  • client.invoices.create()POST /invoicesPassed
  • client.events.stream()GET /eventsPassed
  • client.files.upload()POST /filesPassed

Every operation in your spec, called through the SDK against the mock.

A mock server in every SDK

./scripts/mock --port 4010

Zero dependencies, built from your spec, with request checks and forced statuses.

One command runs it all

./scripts/test

The contract suite against the mock, then the SDK’s own native tests.

One merged change. Every surface follows.

Merge a change to your API and the SDKs, the docs site, the MCP server and the changelog update together, using the names you set in SDK Studio. Versions follow semver, so a breaking change ships as a new major version.

With auto-publish on. One merge, every surface.

A pull request against the OpenAPI spec adds POST /v1/batches and marks /v1/legacy/cancel deprecated. Once it is merged, Octri publishes a docs page for the new endpoint and a deprecation strip on the old one, releases SDK version 1.9.0 in every language, adds a batches_create tool to the MCP server and flags the old tool, and writes a changelog entry for both changes.

Read by coding agents

Typed methods and doc comments in the package, in every language.

llms.txt and markdown

Your docs site publishes both, from the same spec as the SDKs.

One permission list

An endpoint you leave out of the SDK gets no MCP tool either.

Watched from day one

Uptime checks and a status page from the same endpoints.

After releaseSDK error reporting

SDK error tracking, built into every client

Every SDK Octri generates includes an error reporter that is off by default. When a developer using your SDK turns it on, failures in their app reach you with the SDK version, language, method and status, grouped into issues and tagged to the release that caused them.

  • Credentials and personal data redacted inside the SDK before anything is sent
  • Alerts for new issues and regressions, to Slack or a webhook
  • On every plan, Free included
The Issues table: production errors from the SDK grouped by fingerprint, each row carrying its message, the endpoint it came from, how many events and users it has hit, when it was last seen, and whether it is unresolved or has regressed.
For teamsSecurity and access control

Ready for the whole team

The repositories and packages are yours. Roles and two-factor sign-in come on every plan, an activity log on Business, and SAML single sign-on on Enterprise.

Your code, your repositories

Every SDK lands in a repository you own, and each change arrives as a pull request.

Your registry accounts

Packages publish under your own names on npm, PyPI, Maven Central and the rest.

Roles and permissions

Granular roles for everyone in your organisation, on every plan.

Activity log

Every member action recorded, on Business and Enterprise.

Two-factor sign-in

Authenticator-app two-factor on every plan, required for everyone on Enterprise.

Single sign-on

SAML single sign-on for your whole organisation on Enterprise.

Migration · Switch SDK generators

Switch from Stainless, Speakeasy, Fern or liblab

Bring your stainless.yml, Speakeasy workflow.yaml, fern folder or liblab.config.json and Octri rebuilds the SDKs from it. Your next release keeps the package names your users already install, and a call to plan the move is free.

From Speakeasy, workflow.yaml brings: Spec, languages, package name, author. From Stainless, stainless.yml brings: Languages, package name, method names. From Fern, generators.yml brings: Spec, languages, package names. From liblab, liblab.config.json brings: Spec, languages, auth, package name.

Start free. Pay when the API grows.

Free includes one SDK language and most of the SDK Studio features below. Buy SDKs on its own from $49/mo, or get all four products in a bundle.

What do you need?
SDKs on its own, with twice the endpoints of the same plan in a bundle.
Free
$0/mo

SDKs free, for as long as you like.

  • 1 SDK language
  • 50 endpoints
Start for free
Starter
$42/mo+ tax

billed annually

For indie devs shipping production APIs.

  • 2 SDK languages
  • 200 endpoints
Choose Starter
Recommended
Growth
$127/mo+ tax

billed annually

For growing teams shipping fast.

  • 4 SDK languages
  • 600 endpoints
Choose Growth
Business
$212/mo+ tax

billed annually

For scaling products that need more.

  • All 10 languages
  • 1,200 endpoints
Choose Business
Enterprise
Custom

Custom limits, an SLA and SSO.

Contact sales

Buying SDKs on its own keeps Docs, MCP and Monitoring on their Free plans. Add any of them, or switch to a bundle, from your billing page whenever you like.

FeatureFree$0/moStart freeStarter$42/moChooseGrowth$127/moChooseBusiness$212/moChooseEnterpriseCustomContact
Plan and usageWhat this product includes, and the account it comes with.
SDK languages includedAny of the ten, your choice124All 10Unlimited
Additional SDK languagesNo+$50/mo each+$50/mo eachIncludedIncluded
API endpointsDocumented, generated and exposed as tools502006001,200Unlimited
Projects11510Unlimited
Team membersPriced per organisation, never per seatUnlimitedUnlimitedUnlimitedUnlimitedUnlimited
SDK StudioIdiomatic client libraries in TypeScript, Python, Go, Java, Kotlin, Ruby, PHP, Swift, Dart and Rust.
Explore SDK Studio
Typed models, errors, and responsesYesYesYesYesYes
Auth wired in from your security schemesYesYesYesYesYes
Document every method and modelYesYesYesYesYes
Auto-generated unit tests per SDKYesYesYesYesYes
Pagination SupportYesYesYesYesYes
Streaming SupportYesYesYesYesYes
Built-in Retries and Idempotency SupportYesYesYesYesYes
Bundled README with Usage ExamplesYesYesYesYesYes
Auto-generated mock server per SDKYesYesYesYesYes
Zero-dependencies out of the box**Depends on your language and custom dependenciesYesYesYesYesYes
Deep SDK customization choicesCustomize from the HTTP library all the way to each method's signaturesYesYesYesYesYes
Live SDK usage previewYesYesYesYesYes
Monitor SDK Usage and ErrorsAccurately measure client-side and server-side latency (Optional)YesYesYesYesYes
Publish to package registriesNPM, PyPI, Maven, RubyGems, crates.io, pub.dev, and git tags for Go, PHP, SwiftYesYesYesYesYes
Download builds before publishingYesYesYesYesYes
Migrate from other SDK GeneratorsYesYesYesYesYes
SDK build retentionBuilds stored per language13520Unlimited
CLI GeneratorNoNoYesYesYes
Custom DependenciesInclude Custom Dependencies in your SDKsNoNoYesYesYes
Custom CodeRun your own code around each method with HooksNoNoYesYesYes
CDN-hosted SDK artifactsNoNoNoYesYes
White-labelNoNoNoNoYes
Team and securityCustomize your team's access
RBAC-based AuthorizationYesYesYesYesYes
Multi-factor sign-inYesYesYesYesYes
Member Audit logsNoNoNoYesYes
Session IP allowlistNoNoNoYesYes
Custom SLAsNoNoNoNoYes
SAML SSONoNoNoNoYes
SupportAny questions or issues? We're all ears!
SupportCommunity & EmailCommunity & EmailPriorityPriorityDedicated
24/7 Incident monitoringYesYesYesYesYes
Migration SupportYesYesYesYesYes
Slack SupportNoNoNoNoYes
Dedicated Customer Integration SupportNoNoNoNoYes
FAQSDK generator questions

Questions about generating SDKs

Import an OpenAPI, Swagger or Postman file, connect the repository it lives in, or add endpoints in the editor, then choose a language and generate. The build lands in a repository you own, and you can publish it from Octri or download it as a zip on any plan. The Free plan covers one language and up to 50 endpoints, with no card.

Ship your first SDK today, free

Start with one language at no cost and add more as your users ask for them. See every plan