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

# Conventions

Grain's API provides a comprehensive set of endpoints for managing hedging, spot transactions, pricing, and fund movements — enabling seamless integration of FX workflows into your platform.

## Base URL

```text theme={null}
https://api.grainfinance.co/v1
```

## Environments

| Environment | Base URL                                                   |
| :---------- | :--------------------------------------------------------- |
| Sandbox     | `https://api.grainfinance.co/v1` (use Sandbox credentials) |
| Live        | `https://api.grainfinance.co/v1` (use Live credentials)    |

Switch between environments by swapping your Client ID and Secret — the base URL is the same for both.

## Response format

All responses are JSON. Errors follow a consistent structure:

```json theme={null}
{
  "message": "A description of the error"
}
```

HTTP status codes follow standard conventions: `2xx` for success, `4xx` for client errors, `5xx` for server errors.

## OpenAPI Specification:

Download the full specification [here](https://grain-docs-assets.s3.us-east-1.amazonaws.com/openapi.yaml).
