# First Steps GraphQL API

Learn how to access Azion **GraphQL API** and the **GraphQL** playground.

---

## Accessing GraphQL API

To use **GraphQL API** with API platforms such as Postman and Insomnia, you first need authentication to ensure requests access data securely. This authentication occurs through **Tokens**.

To create a Token, you can follow two different paths:

- Use Azion **API platform**.
- Use **Azion Console**.

The first option is to create a **Token** through the Azion [API platform](https://api.azion.com/). You can go to [Token](https://api.azion.com/#6d423af0-36b7-4cc1-85aa-ff4d7037f610) and run your request.

The second option is to create a **Personal Token** through the Azion configuration interface, [Azion Console](https://console.azion.com). This option is more suitable for use with APIs due to the possibility of creating a long-lived token. See the [Personal Tokens](/en/documentation/products/accounts/personal-tokens/) documentation page to create one.

:::tip
When creating a personal token, you'll have to set an *expiration date*. For use with APIs, it's recommended to set a longer expiration date, such as *90 days* or *1 year*. In that case, make sure you take the necessary precautions to ensure your project's security.
:::

After creating your personal token, head to the API platform you'll be using and include the Azion GraphQL API endpoint in your request:

- To use the Real-Time Metrics API for aggregated data, include: `https://api.azion.com/v4/metrics/graphql`
- To use the Real-Time Events API for raw data, include: `https://api.azion.com/v4/events/graphql`
- To use the Billing API for financial data, include: `https://api.azion.com/v4/billing/graphql`
- To use the Accounting API for financial data, include: `https://api.azion.com/v4/accounting/graphql`
- To use the Consumption API for usage data, include: `https://api.azion.com/v4/consumption/graphql`

---

## Accessing the GraphiQL Playground

You can use Azion **GraphQL** built-in playground to write, validate, and test GraphQL queries. Using the playground can help you become more familiar with the API and the use of queries in a visual and quick manner.

To interact with the GraphiQL Playground, you must first log in to [Azion Console](https://console.azion.com). If you haven't created an account, check the [Creating an account on Azion](/en/documentation/products/accounts/creating-account/) documentation page.

After successfully logging in to **Azion Console**, go to one of the links:

- `https://api.azion.com/v4/metrics/graphql`
- `https://api.azion.com/v4/events/graphql`
- `https://api.azion.com/v4/billing/graphql`
- `https://api.azion.com/v4/accounting/graphql`
- `https://api.azion.com/v4/consumption/graphql`

Feel free to interact with the GraphiQL Playground.

:::tip
After you execute a query, the URL path is updated with an encoded parameter of the specific query you're using. You can copy and share the URL with other users so they can use the same query.
:::