> For the complete documentation index, see [llms.txt](https://docs.1q.gg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1q.gg/documentation/getting-started/inicio-rapido-primeira-sessao.md).

# Início rápido — primeira sessão

Go from sign-up to your first deploy in under five minutes.

{% hint style="info" %}
Os exemplos usam variáveis de ambiente. Não cole chaves reais no terminal compartilhado. O jogo POCKETGAMES:98 é ilustrativo e pode não estar disponível.
{% endhint %}

## 1. Autentique uma consulta

{% tabs %}
{% tab title="Node.js" %}

```javascript
import {createHmac,createHash,randomUUID} from 'node:crypto';
const origin = 'https://api.1q.gg';
async function oneq(method,path,payload,idemKey) {
  const body = payload === undefined ? '' : JSON.stringify(payload);
  const timestamp = String(Math.floor(Date.now()/1000));
  const nonce = randomUUID();
  const bodyHash = createHash('sha256').update(body).digest('hex');
  const pathname = new URL(path,origin).pathname;
  const canonical = [method.toUpperCase(),pathname,timestamp,nonce,bodyHash].join('\\n');
  const signature = createHmac('sha256',process.env.ONEQ_SECRET).update(canonical.replaceAll('\\n','\n')).digest('hex');
  const headers = {'X-Operator-Key':process.env.ONEQ_PUBLIC_KEY,'X-1Q-Timestamp':timestamp,'X-1Q-Nonce':nonce,'X-1Q-Signature':signature,'Accept':'application/json'};
  if (body) headers['Content-Type']='application/json';
  if (idemKey) headers['Idempotency-Key']=idemKey;
  const res=await fetch(new URL(path,origin),{method,headers,body:body||undefined});
  const json=await res.json();
  if(!res.ok) throw new Error(JSON.stringify(json));
  return json;
}
const catalog = await oneq('GET','/api/v1/games?launchable=true&per_page=10');
console.log(catalog.data);
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$path = '/api/v1/games?launchable=true&per_page=10';
$ts = (string) time(); $nonce=bin2hex(random_bytes(16));
$canonical=implode("\n",['GET',parse_url($path,PHP_URL_PATH),$ts,$nonce,hash('sha256','')]);
$sig=hash_hmac('sha256',$canonical,getenv('ONEQ_SECRET'));
$headers=['X-Operator-Key: '.getenv('ONEQ_PUBLIC_KEY'),'X-1Q-Timestamp: '.$ts,'X-1Q-Nonce: '.$nonce,'X-1Q-Signature: '.$sig];
$ch=curl_init('https://api.1q.gg'.$path);
curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_HTTPHEADER=>$headers]);
echo curl_exec($ch); curl_close($ch);
```

{% endtab %}
{% endtabs %}

## 2. Lance um jogo

Use o par provider/game retornado pelo catálogo, somente se launchable=true.

```json
{
  "user_code":"player_123",
  "game_code":"98",
  "provider":"POCKETGAMES",
  "game_original":true,
  "user_balance":"100.0000",
  "currency":"BRL",
  "lang":"pt-BR",
  "return_url":"https://cassino.exemplo/lobby"
}
```

Chame POST /api/v1/launches com os mesmos cabeçalhos, Content-Type: application/json e Idempotency-Key única por tentativa lógica. A resposta HTTP 200 inclui data.request\_id, data.session\_id, data.launch\_url e data.expires\_at.

{% hint style="warning" %}
Um jogo estar no catálogo não garante lançamento: políticas do provedor, disponibilidade, perfil e certificação podem bloqueá-lo.
{% endhint %}

## 3. Exiba a URL

Abra launch\_url exatamente como retornada. Não reconstrua o endereço e não reutilize URLs de sessões expiradas.

## 4. Recupere resultados

Use GET /api/v1/launches/{requestId} com uma requisição HMAC nova. Em retry de lançamento, conserve a Idempotency-Key e corpo originais; gere timestamp, nonce e assinatura novos.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.1q.gg/documentation/getting-started/inicio-rapido-primeira-sessao.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
