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

# API Environments

> Understanding Prezio API environments for development and production

Prezio provides two distinct environments for API access, each serving a specific purpose in your development lifecycle.

## Available Environments

<CardGroup cols={2}>
  <Card title="Sandbox" icon="flask" color="#c7beff">
    **URL**: `https://sandbox.prezio.eu/api/`

    Development and testing environment with sample data and relaxed rate limits.
  </Card>

  <Card title="Production" icon="server" color="#83b5ab">
    **URL**: `https://api.prezio.eu/api/`

    Live environment with complete data coverage and standard rate limits.
  </Card>
</CardGroup>

## Development Workflow

<Steps>
  <Step title="Start with Sandbox">
    Begin your integration using the sandbox environment with test data.
  </Step>

  <Step title="Test Thoroughly">
    Validate your implementation with various scenarios and edge cases.
  </Step>

  <Step title="Move to Production">
    Once testing is complete, switch to the production environment with the same code and API key but different base URL.
  </Step>
</Steps>

## Sandbox Environment

The sandbox environment is your development and testing playground, offering:

<CardGroup cols={3}>
  <Card title="Safe Testing" icon="code" color="#83b5ab">
    Test without affecting production systems or incurring unexpected charges.
  </Card>

  <Card title="Real Data" icon="database" color="#8099a8">
    Access limited but real pricing data across supported markets.
  </Card>

  <Card title="Error Simulation" icon="triangle-exclamation" color="#ffb07c">
    Test error handling with invalid parameters or rate limit scenarios.
  </Card>
</CardGroup>

<Warning>
  **Sandbox Limitations**: The sandbox environment is provided as-is, without service level guarantees. Updates and changes may be released at any time without prior notice. API structure, responses, or data availability may change as the service evolves. While we strive to maintain stability, the sandbox environment is primarily intended for development and testing purposes, not for production applications.
</Warning>

### Data Coverage

<Note>
  Sandbox has limited geographic coverage. See our [data availability guide](/essentials/data-availability) for details on supported regions.
</Note>

### Sandbox Characteristics

<AccordionGroup>
  <Accordion title="Rate Limits" icon="gauge-high" defaultOpen>
    Higher limits than production, but still enforced to encourage proper implementation.
  </Accordion>

  <Accordion title="Data Freshness" icon="clock">
    Price updates may be delayed by up to one week compared to real-time production data.
  </Accordion>

  <Accordion title="API Behavior" icon="code-branch">
    Identical API structure and response formats to production, ensuring seamless transition.
  </Accordion>
</AccordionGroup>

## Production Environment

The production environment provides live electricity pricing data with full market coverage and reliability guarantees.

### Production Features

<CardGroup cols={2}>
  <Card title="Complete Coverage" icon="globe" color="#629f93">
    Access to all supported countries, bid zones, organizations and price components, according to your contract.
  </Card>

  <Card title="Real-time Data" icon="bolt" color="#3f8376">
    Up-to-date pricing information synchronized with market data sources.
  </Card>

  <Card title="Performance" icon="gauge-simple-high" color="#b4dbd3">
    Optimized for scalability and reliability with standard rate limits based on your subscription tier.
  </Card>

  <Card title="Customer support" icon="headset" color="#c7beff">
    Ongoing support available at [support@prezio.eu](mailto:support@prezio.eu) in case of questions or issues with tariffs.
  </Card>
</CardGroup>

## Environment Configuration

Use the same API key for both environments, but call different base URLs:

```bash
# Sandbox request (open access)
curl -X GET "https://sandbox.prezio.eu/api/live/?country=DK&tariff_id=tar_123" \
  -H "Authorization: Token YOUR_API_KEY"

# Production request (requires contract)
curl -X GET "https://api.prezio.eu/api/live/?country=DK&tariff_id=tar_123" \
  -H "Authorization: Token YOUR_API_KEY"
```

<Tip>
  Use environment variables or configuration files to easily switch between environments:

  ```javascript
  const API_URL = process.env.NODE_ENV === 'production'
    ? 'https://api.prezio.eu/api'
    : 'https://sandbox.prezio.eu/api';
    
  const API_KEY = process.env.PREZIO_API_KEY; // Same key for both environments
  ```
</Tip>

<Note>
  **Access Control**: Sandbox access is available to all registered users. Production access requires a contract - contact [support@prezio.eu](mailto:support@prezio.eu) to enable production access.
</Note>

## Best Practices

1. **Develop in sandbox first** before deploying to production
2. **Maintain environment parity** by using identical code for both environments
3. **Implement proper error handling** for all API responses
4. **Monitor API usage** to stay within your rate limits
5. **Use the same API key** for both environments, switching only the base URL

Need assistance with environment setup? Contact our support team at [support@prezio.eu](mailto:support@prezio.eu).
