# Using Rest APIs

Q Blocks offers a detailed swagger documentation for launching and managing GPU instances via our Rest APIs.

To get started, you'd need 2 information pieces:

1. [Your Q Blocks Client ID](#q-blocks-client-id)
2. [An Authentication Token](#authentication-token)

#### Q Blocks Client ID:

Your Q Blocks client ID is a unique string that helps us identify your account when you send API requests.

Access your Q Blocks `client_id` [here](https://www.qblocks.cloud/client/v2/account/auth).

#### Authentication Token:

A bearer auth token is required in header of each API request sent by you as that'd help us authenticate your requests.

Generate an authentication token [here](https://www.qblocks.cloud/client/v2/account/auth).

1. Click on "Create new Auth Token" button.
2. Select the permissions you'd like to add to your auth token.
3. Click "Generate Auth Token" button.

Store the newly generated auth token somewhere safe.

After you have successfully generated an auth token and copied your client\_id, you are all set to send requests to our Rest APIs for launching and managing GPU instances.

Please refer to below links for performing different actions:

1. [View available GPU types and Launch a GPU instance](https://controlapi.qblocks.cloud/docs?urls.primaryName=Instance%20API%20\(Creation\))
2. [Perform instance actions like: Start, Stop, Restart, Command run, ](https://controlapi.qblocks.cloud/docs?urls.primaryName=Instance%20Action%20API#/Action)[Delete](https://controlapi.qblocks.cloud/docs?urls.primaryName=Instance%20Action%20API#/Action)
3. [Fetch instance information like: Status, Logs, Access credentials](https://controlapi.qblocks.cloud/docs?urls.primaryName=Instance%20Action%20API#/Info)

With these APIs, you are all set to access scalable GPU infrastructure on Q Blocks at upto 60% low cost for your AI/ML workloads.

#### Technical support:

For any query or issues in getting started, reach us out at <support@qblocks.cloud> for quick resolution.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.qblocks.cloud/launch-a-q-blocks-gpu-instance/using-rest-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
