> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aireserve.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> SDK configuration options — API key, base URL, timeouts, and retries — with consistent semantics everywhere.

| 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)        |

Timeout semantics are consistent everywhere: the timeout bounds connection + headers (and,
for non-streaming `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.

<CodeGroup>
  ```python Python theme={"dark"}
  client = Audacity(
      api_key="aireserve_api_…",
      base_url="https://api.aireserve.com",
      timeout=60.0,
      max_retries=3,
  )
  ```

  ```typescript TypeScript theme={"dark"}
  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 },
  );
  ```

  ```go Go theme={"dark"}
  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.
  ```

  ```java Java theme={"dark"}
  var client = AudacityRuntimeClient.builder()
      .apiKey("aireserve_api_…")
      .baseUrl("https://api.aireserve.com")
      .timeout(Duration.ofSeconds(60))
      .maxRetries(3)
      .build();
  ```

  ```rust Rust theme={"dark"}
  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)?;
  ```
</CodeGroup>
