Best-in-class SDKs and MCP for your API.

Developers expect your API to come with a type-safe client library in their preferred programming language. 

From the team behind Stripe's patented code generation system, Stainless generates robust, idiomatic SDKs that elegantly handle HTTP requests, streaming, and more.

Node

Python

Go

Java

Kotlin

Ruby

Terraform

import OpenAI from 'openai';

async function main() {
  const openai = new OpenAI();
  const completion = await openai.chat.completions.create({
    model: 'gpt-4.1',
    messages: [{
      role: 'user',
      content: 'Say this is a test',
    }],
  });
  console.log(completion.choices[0]?.message.content);
}

main();

Node

Python

Go

Java

Kotlin

Ruby

Terraform

import OpenAI from 'openai';

async function main() {
  const openai = new OpenAI();
  const completion = await openai.chat.completions.create({
    model: 'gpt-4.1',
    messages: [{
      role: 'user',
      content: 'Say this is a test',
    }],
  });
  console.log(completion.choices[0]?.message.content);
}

main();

Node

Python

Go

Java

Kotlin

Ruby

Terraform

import OpenAI from 'openai';

async function main() {
  const openai = new OpenAI();
  const completion = await openai.chat.completions.create({
    model: 'gpt-4.1',
    messages: [{
      role: 'user',
      content: 'Say this is a test',
    }],
  });
  console.log(completion.choices[0]?.message.content);
}

main();

Node

Python

Go

Java

Kotlin

Ruby

Terraform

import OpenAI from 'openai';

async function main() {
  const openai = new OpenAI();
  const completion = await openai.chat.completions.create({
    model: 'gpt-4.1',
    messages: [{
      role: 'user',
      content: 'Say this is a test',
    }],
  });
  console.log(completion.choices[0]?.message.content);
}

main();

Robust & polished SDKs

Great SDKs for your API drive faster integration, broader feature adoption, quicker upgrades, and trust in your engineering quality.

At Stainless, we work hard to make each SDK feel as though it were hand-written by an expert in the language who had the time to get it right.

All our libraries include: rich types (for autocomplete and docs on hover), auto-pagination, auto-retry with backoff, seamless auth, and much more.

Examples of SDKs we've produced:

Examples of SDKs we've produced:

Examples of SDKs we've produced:

Examples of SDKs we've produced:

Examples of SDKs we've produced:

Examples of SDKs we've produced:

Provide your OpenAPI spec

All Stainless needs to get started is your OpenAPI spec. It doesn’t have to be perfect.

We’ll create a starter Stainless config file that standardizes naming and defines core functionality like pagination and authentication.

openapi: 3.0.0 
paths: 
  /chat/completions: 
    post: 
      operationId: createChatCompletion 
      tags: 
        - OpenAI 
      summary: Creates a model response for the given chat conversation. 
      requestBody

Generate your SDKs

Receive shippable SDKs in the languages your developers demand.

Node / Typescript
Node / Typescript
Node / Typescript

Edit

Edit

Edit

Edit

Python
Python
Python

Edit

Edit

Edit

Edit

Java
Java
Java

Edit

Edit

Edit

Edit

Terraform
Terraform
Terraform

Edit

Edit

Edit

Edit

PHP
PHP
PHP

Edit

Edit

Edit

Edit

Go
Go
Go

Edit

Edit

Edit

Edit

Kotlin
Kotlin
Kotlin

Edit

Edit

Edit

Edit

Ruby
Ruby
Ruby

Edit

Edit

Edit

Edit

C#
C#
C#

Edit

Edit

Edit

Edit

Iterate & customize

You can customize the Stainless configuration for more bespoke SDKs that best represent you and your developers by fine-tuning names, docs, and more.

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

/chat/completions:

post:

operationId: createChatCompletion

tags:

- Chat

summary: Creates a model response for the given chat conversation

requestBody:

required: true

content:

application/json:

schema:

$ref: ‘#/components/schemas/CreateChatCompletionRequest’


SDK Reference Preview

Edit

client.

completions

create

(body: CompletionCreateParams, options?: RequestOptions): CompletionCreateResponse

Snippet

Edit

import OpenAI from 'openai';

const openai = new OpenAI();

async function main() {

const completionCreateResponse = await openai.completions.create

model: ‘string’,

prompt: ‘This is a test.’,

});


console.log(completionCreateResponse.id);

}


main();

Add any custom code, anywhere

Unlike other codegen systems, you can freely edit the generated code as if it were a normal repo – any change, anywhere in the codebase. Your changes will persist the next time Stainless generates a new version.

Merged

Add AI helper method : completion generator #8211

Changes from

all commits

File Filter

Conversations

Review changes

...

1

2

3

4




...

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

   @@ -0,0 +6,87 @@ 
   class OpenAI extends Core.APIClient {
     this.project = project;
   }

+  /**
+   * Helper method to generate a completion, summarize it, and create an image based on the summary.
+   */
+  async generateAndVisualize(prompt: string): Promise<string> {
+    try {
+      const completion = await this.completions.create({
+        model: 'text-davinci-003',
+        prompt,
+        max_tokens: 100,
+      });
+      const generatedText = completion?.choices[0]?.text.trim();
+
+      const summary = await this.completions.create({
+        model: 'text-davinci-003',
+        prompt: `Summarize the following text: ${generatedText}`,
+        max_tokens: 50,

Merged

Add AI helper method : completion generator #8211

Changes from

all commits

File Filter

Conversations

Review changes

...

1

2

3

4




...

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

   @@ -0,0 +6,87 @@ 
   class OpenAI extends Core.APIClient {
     this.project = project;
   }

+  /**
+   * Helper method to generate a completion, summarize it, and create an image based on the summary.
+   */
+  async generateAndVisualize(prompt: string): Promise<string> {
+    try {
+      const completion = await this.completions.create({
+        model: 'text-davinci-003',
+        prompt,
+        max_tokens: 100,
+      });
+      const generatedText = completion?.choices[0]?.text.trim();
+
+      const summary = await this.completions.create({
+        model: 'text-davinci-003',
+        prompt: `Summarize the following text: ${generatedText}`,
+        max_tokens: 50,

Automate your updates

Push your updated OpenAPI spec to us whenever it changes with a GitHub Action (or equivalent). We regenerate your SDK and open a pull request.

on: {push: {branches: [main]}} 
jobs: 
  stainless: 
    steps: 
      - uses: actions/checkout@v3 
      - uses

Publish your packages

You approve our PR and we automatically release the new SDK to your GitHub repos and npm, pypi, or maven packages. You own the code, we automate the toil, and your security team is happy. 

“Proud to have Stainless as a partner at OpenAI.

All our SDKs are generated by them. The team is extremely thoughtful about SDK design and push us to improve our API + other products while they're at it.

Stainless is bringing a new standard of SDKs to our industry and this is a great thing for all developers.”

Nikunj Handa

API Product - OpenAI

90%

pre-existing issues closed or triaged in new SDK

“Proud to have Stainless as a partner at OpenAI.

All our SDKs are generated by them. The team is extremely thoughtful about SDK design and push us to improve our API + other products while they're at it.

Stainless is bringing a new standard of SDKs to our industry and this is a great thing for all developers.”

Nikunj Handa

API Product - OpenAI

90%

pre-existing issues closed or triaged in new SDK

“Proud to have Stainless as a partner at OpenAI.

All our SDKs are generated by them. The team is extremely thoughtful about SDK design and push us to improve our API + other products while they're at it.

Stainless is bringing a new standard of SDKs to our industry and this is a great thing for all developers.”

Nikunj Handa

API Product - OpenAI

90%

pre-existing issues closed or triaged in new SDK

“Proud to have Stainless as a partner at OpenAI.

All our SDKs are generated by them. The team is extremely thoughtful about SDK design and push us to improve our API + other products while they're at it.

Stainless is bringing a new standard of SDKs to our industry and this is a great thing for all developers.”

Nikunj Handa

API Product - OpenAI

90%

pre-existing issues closed or triaged in new SDK

“Proud to have Stainless as a partner at OpenAI.

All our SDKs are generated by them. The team is extremely thoughtful about SDK design and push us to improve our API + other products while they're at it.

Stainless is bringing a new standard of SDKs to our industry and this is a great thing for all developers.”

Nikunj Handa

API Product - OpenAI

90%

pre-existing issues closed or triaged in new SDK

“Proud to have Stainless as a partner at OpenAI.

All our SDKs are generated by them. The team is extremely thoughtful about SDK design and push us to improve our API + other products while they're at it.

Stainless is bringing a new standard of SDKs to our industry and this is a great thing for all developers.”

Nikunj Handa

API Product - OpenAI

90%

pre-existing issues closed or triaged in new SDK

Stainless: the API Company

You can think of us like Stripe's API platform for any REST API, but our ambitions are a little bigger, and our starting point is a little narrower.

We’re building a full-stack TypeScript API Framework. It’s inspired by the internal API Framework we used at Stripe, and will enable you to build amazing REST API’s from the get-go with end-to-end type safety, pagination, auth, and more built-in.

Know when the framework launches

We’re building a full-stack TypeScript API Framework. It’s inspired by the internal API Framework we used at Stripe, and will enable you to build amazing REST API’s from the get-go with end-to-end type safety, pagination, auth, and more built-in.

Know when the framework launches

We’re building a full-stack TypeScript API Framework. It’s inspired by the internal API Framework we used at Stripe, and will enable you to build amazing REST API’s from the get-go with end-to-end type safety, pagination, auth, and more built-in.

Know when the framework launches

We’re building a full-stack TypeScript API Framework. It’s inspired by the internal API Framework we used at Stripe, and will enable you to build amazing REST API’s from the get-go with end-to-end type safety, pagination, auth, and more built-in.

Know when the framework launches

We’re building a full-stack TypeScript API Framework. It’s inspired by the internal API Framework we used at Stripe, and will enable you to build amazing REST API’s from the get-go with end-to-end type safety, pagination, auth, and more built-in.

Know when the framework launches

We’re building a full-stack TypeScript API Framework. It’s inspired by the internal API Framework we used at Stripe, and will enable you to build amazing REST API’s from the get-go with end-to-end type safety, pagination, auth, and more built-in.

Know when the framework launches

"If I told an engineer they have to build all these libraries, they’d tell me it would take at least a year. With Stainless, it’s like magic.”

Kamil Sindi

Head of Engineering - Lithic

$230k

saved annually in engineer salaries

"If I told an engineer they have to build all these libraries, they’d tell me it would take at least a year. With Stainless, it’s like magic.”

Kamil Sindi

Head of Engineering - Lithic

$230k

saved annually in engineer salaries

"If I told an engineer they have to build all these libraries, they’d tell me it would take at least a year. With Stainless, it’s like magic.”

Kamil Sindi

Head of Engineering - Lithic

$230k

saved annually in engineer salaries

"If I told an engineer they have to build all these libraries, they’d tell me it would take at least a year. With Stainless, it’s like magic.”

Kamil Sindi

Head of Engineering - Lithic

$230k

saved annually in engineer salaries

"If I told an engineer they have to build all these libraries, they’d tell me it would take at least a year. With Stainless, it’s like magic.”

Kamil Sindi

Head of Engineering - Lithic

$230k

saved annually in engineer salaries

"If I told an engineer they have to build all these libraries, they’d tell me it would take at least a year. With Stainless, it’s like magic.”

Kamil Sindi

Head of Engineering - Lithic

$230k

saved annually in engineer salaries