# Jupiter API Rust Client
[](https://crates.io/crates/jupiter-api-rs)
## Installation
Add the crate to an application that provides an async runtime, such as Tokio:
```bash
cargo add jupiter-api-rs
cargo add tokio --features macros,rt-multi-thread
```
## Usage
The factory configures the required `x-api-key` header. Generated methods use
an additive builder: required parameters are passed to the builder constructor,
then optional parameters are set fluently.
```rust
use jupiter_api_rs::create_jupiter_api;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let jupiter = create_jupiter_api("your-jupiter-api-key");
let order = jupiter
.get_order_builder(
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"1000000",
)
.slippage_bps(50)
.send()
.await?;
println!("{order:#?}");
Ok(())
}
```
Use `create_jupiter_tx_api(api_key)` to create the separate transaction
submission client for `https://tx.jup.ag`.
## Development
This crate is part of the repository's root Cargo workspace. Its checked-in
clients are generated by `openapi-to-rust` from the same composite OpenAPI
specifications as the TypeScript package.
Install the generator once:
```bash
cargo install --locked openapi-to-rust
```
Then, from the repository root:
```bash
# Refresh canonical inputs and regenerate both Rust clients.
just generate
# Format, type-check, or compile the Rust workspace.
just fmt
just check
just build
```
## Releases
Rust changesets are managed by `cargo-changeset` and stored under
`.changeset/changesets/`, separately from npm Changesets. They generate this
crate's `CHANGELOG.md` and tags in the `jupiter-api-rs@v*` format.
```bash
just changeset
just release
```