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

# Get API Key Info

> Get information about how to generate and use API keys for Pierre Finance

<Note>
  Este endpoint retorna informações sobre como gerar e usar API keys.
</Note>

## Descrição

O endpoint `GET /tools/api/get-api-key-info` retorna informações detalhadas sobre como gerar e usar API keys para acessar os serviços da Pierre Finance.

## Autenticação

Este endpoint **não requer** autenticação.

## Resposta

### Sucesso (200)

<ResponseExample>
  ```json Success theme={null}
  {
    "message": "To use Pierre Finance API tools, you need to generate an API key.",
    "steps": [
      "1. Visit https://www.pierre.finance/api-key",
      "2. Sign in to your account",
      "3. Create a new API key or use the default one",
      "4. Copy the API key (starts with \"sk-\")",
      "5. Use this API key in your requests to other tools"
    ],
    "example": {
      "tool": "get-accounts",
      "endpoint": "GET /tools/api/get-accounts",
      "headers": {
        "Authorization": "Bearer sk-your-api-key-here",
        "Content-Type": "application/json"
      }
    },
    "note": "API keys são necessárias para todo acesso a dados financeiros. Mantenha sua API key segura e nunca a compartilhe publicamente.",
    "availableTools": [
      {
        "name": "get-accounts",
        "endpoint": "/tools/api/get-accounts",
        "method": "GET",
        "description": "Obtém todas as contas financeiras do usuário",
        "requiresAuth": true,
        "category": "Accounts"
      },
      {
        "name": "get-balance",
        "endpoint": "/tools/api/get-balance",
        "method": "GET",
        "description": "Obtém o saldo consolidado de todas as contas bancárias",
        "requiresAuth": true,
        "category": "Balance"
      },
      {
        "name": "get-balance-by-account",
        "endpoint": "/tools/api/get-balance-by-account",
        "method": "GET",
        "description": "Obtém o saldo e detalhes de uma conta bancária específica",
        "requiresAuth": true,
        "category": "Balance"
      },
      {
        "name": "get-transactions",
        "endpoint": "/tools/api/get-transactions",
        "method": "GET",
        "description": "Obtém o histórico de transações financeiras com opções de filtro",
        "requiresAuth": true,
        "category": "Transactions"
      },
      {
        "name": "get-installments",
        "endpoint": "/tools/api/get-installments",
        "method": "GET",
        "description": "Obtém transações parceladas de cartão de crédito e estatísticas",
        "requiresAuth": true,
        "category": "Installments"
      },
      {
        "name": "get-bills",
        "endpoint": "/tools/api/get-bills",
        "method": "GET",
        "description": "Obtém faturas de cartão de crédito vencidas",
        "requiresAuth": true,
        "category": "Bills"
      },
      {
        "name": "get-bill-summary",
        "endpoint": "/tools/api/get-bill-summary",
        "method": "GET",
        "description": "Obtém resumo da fatura atual do cartão de crédito (ainda não fechada)",
        "requiresAuth": true,
        "category": "Bills"
      },
      {
        "name": "manage-closing-date",
        "endpoint": "/tools/api/manage-closing-date",
        "method": "POST",
        "description": "Gerencia datas de fechamento de cartão de crédito (operações CRUD)",
        "requiresAuth": true,
        "category": "Closing Dates"
      },
      {
        "name": "manual-update",
        "endpoint": "/tools/api/manual-update",
        "method": "POST",
        "description": "Sincroniza manualmente todas as contas financeiras conectadas e transações",
        "requiresAuth": true,
        "category": "Sync"
      }
    ]
  }
  ```
</ResponseExample>

### Erro Interno (500)

<ResponseExample>
  ```json Error theme={null}
  {
    "error": "Internal server error",
    "message": "Error details"
  }
  ```
</ResponseExample>

## Campos da Resposta

<ResponseField name="message" type="string" required>
  Mensagem explicativa sobre o uso de API keys
</ResponseField>

<ResponseField name="steps" type="array" required>
  Array com os passos para gerar e usar uma API key

  <Expandable title="Steps Array">
    <ResponseField name="[index]" type="string" required>
      Passo individual para gerar e usar API key
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="example" type="object" required>
  Exemplo de como usar a API key

  <Expandable title="Example Object">
    <ResponseField name="tool" type="string" required>
      Nome da ferramenta de exemplo
    </ResponseField>

    <ResponseField name="endpoint" type="string" required>
      Endpoint de exemplo
    </ResponseField>

    <ResponseField name="headers" type="object" required>
      Headers de exemplo para usar a API key

      <Expandable title="Headers Object">
        <ResponseField name="Authorization" type="string" required>
          Header de autorização com Bearer token
        </ResponseField>

        <ResponseField name="Content-Type" type="string" required>
          Tipo de conteúdo da requisição
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="note" type="string" required>
  Nota importante sobre segurança da API key
</ResponseField>

<ResponseField name="availableTools" type="array" required>
  Lista de ferramentas disponíveis na API

  <Expandable title="AvailableTools Array">
    <ResponseField name="name" type="string" required>
      Nome da ferramenta
    </ResponseField>

    <ResponseField name="endpoint" type="string" required>
      Endpoint da ferramenta
    </ResponseField>

    <ResponseField name="description" type="string" required>
      Descrição da ferramenta
    </ResponseField>

    <ResponseField name="requiresAuth" type="boolean" required>
      Indica se a ferramenta requer autenticação
    </ResponseField>
  </Expandable>
</ResponseField>

## Exemplos de Uso

### cURL

```bash theme={null}
# Obter informações sobre API keys
curl -X GET 'https://www.pierre.finance/tools/api/get-api-key-info'
```

### JavaScript

```javascript theme={null}
const BASE_URL = 'https://www.pierre.finance/tools/api';

async function getApiKeyInfo() {
  const response = await fetch(`${BASE_URL}/get-api-key-info`);
  return await response.json();
}

// Uso
getApiKeyInfo().then(info => {
  console.log('Passos para gerar API key:', info.steps);
  console.log('Ferramentas disponíveis:', info.availableTools);
});
```

### Python

```python theme={null}
import requests

BASE_URL = 'https://www.pierre.finance/tools/api'

def get_api_key_info():
    response = requests.get(f'{BASE_URL}/get-api-key-info')
    return response.json()

# Uso
info = get_api_key_info()
print('Passos para gerar API key:', info['steps'])
print('Ferramentas disponíveis:', info['availableTools'])
```

## Códigos de Status

* `200`: Sucesso - Informações sobre API keys retornadas
* `500`: Erro interno do servidor

## Uso Recomendado

Este endpoint é útil para:

* **Desenvolvedores** que estão começando a usar a API
* **Documentação** que precisa explicar como obter API keys
* **Ferramentas** que precisam mostrar informações sobre autenticação
* **Testes** que verificam se o serviço está funcionando

<Note>
  Este é o único endpoint que não requer autenticação, sendo útil para verificar se o serviço está online e obter informações sobre como começar a usar a API.
</Note>


## OpenAPI

````yaml GET /tools/api/get-api-key-info
openapi: 3.1.0
info:
  title: Pierre Finance API
  description: >-
    API para acessar dados financeiros do Pierre Finance, incluindo contas,
    transações, parcelas e sincronização.
  version: v1.0.0
servers:
  - url: https://www.pierre.finance
security: []
tags:
  - name: Authentication
    description: API key management and authentication
  - name: Accounts
    description: Financial accounts management
  - name: Transactions
    description: Financial transactions
  - name: Installments
    description: Credit card installments and purchases
  - name: Bills
    description: Credit card bills and current bill summaries
  - name: Balance
    description: Account balance information
  - name: Closing Dates
    description: Credit card closing date management
  - name: Sync
    description: Account synchronization
  - name: Spending Limits
    description: Personal spending limits and alerts management
  - name: Payment Reminders
    description: Payment reminders management with WhatsApp and Email notifications
  - name: Analytics
    description: Financial analytics and insights
  - name: Memories
    description: User memory management for personalized AI interactions
  - name: Open Finance
    description: Open Finance connection and integration
paths:
  /tools/api/get-api-key-info:
    get:
      tags:
        - Authentication
      description: >-
        Get information about how to generate and use API keys for Pierre
        Finance
      operationId: getApiKeyInfo
      responses:
        '200':
          description: API key information and available tools
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: >-
                      To use Pierre Finance API tools, you need to generate an
                      API key.
                  steps:
                    type: array
                    items:
                      type: string
                    example:
                      - 1. Visit https://pierre.finance/api-key
                      - 2. Sign in to your account
                      - 3. Create a new API key or use the default one
                      - 4. Copy the API key (starts with "sk-")
                      - 5. Use this API key in your requests to other tools
                  example:
                    type: object
                    properties:
                      tool:
                        type: string
                        example: get-accounts
                      endpoint:
                        type: string
                        example: GET /tools/api/get-accounts
                      headers:
                        type: object
                        properties:
                          Authorization:
                            type: string
                            example: Bearer sk-your-api-key-here
                          Content-Type:
                            type: string
                            example: application/json
                  note:
                    type: string
                    example: >-
                      API keys are required for all financial data access. Keep
                      your API key secure and never share it publicly.
                  availableTools:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        endpoint:
                          type: string
                        method:
                          type: string
                        description:
                          type: string
                        requiresAuth:
                          type: boolean
                        category:
                          type: string
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Internal server error
                  message:
                    type: string

````