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

# Advanced Configuration

> Advanced configuration options for the Rebase Dashboard API client

## Advanced Client Configuration

For production applications and advanced use cases, the Rebase Dashboard API client provides several configuration options.

## Async Client

For non-blocking API calls, use the async client:

```python theme={null}
import asyncio
from rebase_dashboard import AsyncRebaseDashboardClient

async def main():
    client = AsyncRebaseDashboardClient(
        api_key="YOUR_API_KEY",
    )

    # Create a dashboard asynchronously
    dashboard = await client.dashboards.create_dashboard(
        name="Async Dashboard"
    )

    print(f"Created dashboard: {dashboard.id}")

# Run the async function
asyncio.run(main())
```

## Error Handling

The SDK provides comprehensive error handling for API responses:

```python theme={null}
from rebase_dashboard.core.api_error import ApiError

try:
    dashboard = client.dashboards.create_dashboard(
        name="Test Dashboard"
    )
except ApiError as e:
    print(f"Error {e.status_code}: {e.body}")
    # Handle the error appropriately
```

## Timeouts

Configure request timeouts:

```python theme={null}
# Set default timeout for all requests
client = RebaseDashboardClient(
    api_key="YOUR_API_KEY",
    timeout=30.0  # 30 seconds
)

# Override timeout for specific requests
dashboard = client.dashboards.create_dashboard(
    name="Quick Dashboard",
    request_options={"timeout_in_seconds": 5}
)
```

## Retries

The SDK automatically retries failed requests with exponential backoff:

```python theme={null}
# Configure retry behavior
dashboard = client.dashboards.create_dashboard(
    name="Retry Test",
    request_options={"max_retries": 3}
)
```

## Custom HTTP Client

For advanced use cases like proxies or custom transports:

```python theme={null}
import httpx
from rebase_dashboard import RebaseDashboardClient

client = RebaseDashboardClient(
    api_key="YOUR_API_KEY",
    httpx_client=httpx.Client(
        proxies="http://my.proxy.com",
        transport=httpx.HTTPTransport(local_address="0.0.0.0"),
    )
)
```

## Raw Response Access

Access raw response data including headers:

```python theme={null}
# Get raw response with headers
response = client.dashboards.with_raw_response.create_dashboard(
    name="Raw Response Test"
)

print(f"Status: {response.status_code}")
print(f"Headers: {response.headers}")
print(f"Data: {response.data}")
```

## Environment Variables

For production deployments, use environment variables:

```python theme={null}
import os
from rebase_dashboard import RebaseDashboardClient

client = RebaseDashboardClient(
    api_key=os.getenv("REBASE_API_KEY"),
)
```

## Next Steps

Now that you understand advanced configuration, explore these guides:

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Explore all available endpoints and data structures.
  </Card>

  <Card title="Production Deployment" icon="rocket" href="/installation">
    Learn about production deployment best practices.
  </Card>

  <Card title="Essentials" icon="book" href="/essentials/datasets">
    Learn about datasets and data management.
  </Card>

  <Card title="Weather Integration" icon="cloud" href="/essentials/weather-integration">
    Learn about weather data integration.
  </Card>
</CardGroup>
