| Option | Environment variable | Default |
|---|---|---|
| API key | AUDACITY_API_KEY | — (required) |
| Base URL | AUDACITY_BASE_URL | https://api.aireserve.com |
| Timeout (per attempt) | — | 120 s |
| Max retries | — | 2 (up to 3 attempts) |
Converse, the full body read). For ConverseStream
it applies only until headers arrive — the stream body is never bounded, so
long generations are never cut off mid-stream.
client = Audacity(
api_key="aireserve_api_…",
base_url="https://api.aireserve.com",
timeout=60.0,
max_retries=3,
)
const client = new AudacityRuntimeClient({
apiKey: "aireserve_api_...",
baseUrl: "https://api.aireserve.com",
timeoutMs: 30_000,
maxRetries: 3,
});
// Every operation also accepts an abortSignal (AWS SDK v3 parity),
// which cancels an in-flight stream:
const aborter = new AbortController();
const { stream } = await client.send(
new ConverseStreamCommand({ modelId, messages }),
{ abortSignal: aborter.signal },
);
client := audacityruntime.New(audacityruntime.Options{
APIKey: "aireserve_api_…", // falls back to AUDACITY_API_KEY
BaseURL: "https://…", // falls back to AUDACITY_BASE_URL, then default
HTTPClient: &http.Client{}, // custom transport / TLS config
MaxRetries: 3, // audacityruntime.NoRetries disables retries
Timeout: 60 * time.Second, // audacityruntime.NoTimeout disables it
})
// If you provide a custom HTTPClient, leave its Timeout unset — an
// http.Client timeout bounds the whole body and would kill long streams.
var client = AudacityRuntimeClient.builder()
.apiKey("aireserve_api_…")
.baseUrl("https://api.aireserve.com")
.timeout(Duration.ofSeconds(60))
.maxRetries(3)
.build();
use std::time::Duration;
let config = audacity_sdk::Config::builder()
.api_key("aireserve_api_…")
.base_url("https://api.aireserve.com")
.timeout(Duration::from_secs(120))
.max_retries(2) // 3 total attempts
.build()?;
let client = audacity_sdk::Client::new(&config)?;