--- title: Ruby | Stainless description: Generate production-ready Ruby SDKs from your OpenAPI specification --- Ruby is [fully supported](https://www.stainless.com/changelog/ruby-general-availability). The Stainless Ruby SDK generator creates idiomatic, type-safe Ruby client libraries from your OpenAPI specification. Generated Ruby SDKs include modern type system support (Sorbet, RBS, YARD) and a minimal-dependency design. **Example repositories:** - [anthropics/anthropic-sdk-ruby](https://github.com/anthropics/anthropic-sdk-ruby) - [Increase/increase-ruby](https://github.com/Increase/increase-ruby) - [imagekit-developer/imagekit-ruby](https://github.com/imagekit-developer/imagekit-ruby) - [team-telnyx/telnyx-ruby](https://github.com/team-telnyx/telnyx-ruby) ## Configuration To generate a Ruby SDK, add the `ruby` target to your Stainless configuration file: ``` targets: ruby: gem_name: my_company_client edition: ruby.2025-10-08 ``` ### Common configuration options ``` targets: ruby: gem_name: my_company_client # Specify the edition edition: ruby.2025-10-08 # Configure publishing publish: rubygems: true ``` For a complete list of configuration options, see the [Ruby target reference](/docs/reference/config#ruby/index.md). ## Editions Editions allow Stainless to make improvements to SDKs that aren’t backwards-compatible. You can explicitly opt in to new editions when you’re ready. See the [SDK and config editions reference](/docs/reference/editions/index.md) for more information. #### ruby.2025-10-08 - Initial edition for Ruby (used by default if no edition is specified) ## Publishing to RubyGems Publish your Ruby SDK to [RubyGems](https://rubygems.org/) for distribution. Before publishing, you need to [link a production repository](/docs/sdks/publish#link-production-repos/index.md) where Stainless will push your SDK code. Get an API token 1. Log in or sign up at [RubyGems](https://rubygems.org/). 2. Select your profile picture on the top right to open a dropdown. 3. Navigate to **Settings**. 4. If you have MFA enabled, set the level to “UI and gem signin”. 5. Navigate to **API keys**. 6. Create a new API key with the “Push rubygems” privilege. If you have MFA enabled, make sure “Enable MFA” is unchecked. Add the token to your production repo 1. In your production repo, navigate to **Secrets and variables** > **Actions** > **New repository secret**. The URL should look like `https://github.com///settings/secrets/actions/new`. 2. Add a new secret named `GEM_HOST_API_KEY` with your API token. Choose a package name and update your Stainless config 1. Choose an available package name. Suggested names are: - `` - `-client` You can check whether the name is available by testing the link at `https://rubygems.org/gems/`. 2. Update the [Stainless config](/docs/reference/config#ruby/index.md) with your package name and save. ``` targets: ruby: gem_name: publish: rubygems: true ```