Skygen is a Rust command line tool that turns an OpenAPI v3 specification into an idiomatic Rust SDK. It can generate SDKs for Cloudflare, DigitalOcean, Exoscale, Hetzner, Scaleway and any provider that publishes an OpenAPI spec.
cargo install --path ./skygenskygen generate --schema <schema-file> --output-dir <output-directory> --config <config-file>Skygen uses a TOML configuration file to customize the generated SDK. Here's an example configuration:
crate_name = "my-cloud-sdk"
version = "0.1.0"
edition = "2021"
description = "A Rust SDK for My Cloud Provider API"
lib_status = "active"
keywords = ["cloud", "api", "sdk"]
api_url = "https://api.mycloudprovider.com"
authors = ["Cloudflavor GmbH <foss@cloudflavor.io>"]crate_name: The name of the generated Rust crateversion: The version of the generated crateedition: The Rust edition to use (defaults to "2021")description: A brief description of the cratelib_status: The maintenance status of the library (e.g., "active", "deprecated", "experimental")keywords: A list of keywords for the crateapi_url: The base URL for the APIauthors: A list of authors for the crateinclude_only: (Optional) A list of models to include (if not specified, all models are included)exclude: (Optional) A list of models to exclude
skygen generate \
--schema path/to/openapi.yaml \
--config config.toml \
--output-dir ./outputThe output will contain a Cargo crate with a typical src/ layout and a Cargo.toml that exposes optional features like rustls, native-tls and http2.
The generated SDK includes:
src/lib.rs: Main library entry pointsrc/client.rs: HTTP client implementationsrc/errors.rs: Error typessrc/models/: Generated model typessrc/apis/: Generated API operation functionsCargo.toml: Crate metadata and dependencies
- Full OpenAPI v3 specification support
- Automatic model generation from schemas
- HTTP client with request/response handling
- Error type generation
- Support for complex schema types (arrays, objects, references, oneOf, anyOf, allOf)
- Rust code formatting with
cargo fmt
src/ ├─ lib.rs ├─ client.rs ├─ errors.rs ├─ models/ └─ apis/
See CONTRIBUTING.md for details.
Apache‑2.0 – see the LICENSE file.