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

# Using Team Accounts

> How to use Prime Inference with team accounts

When using Prime Inference with a team account, you must explicitly pass your team ID to charge against team credits instead of your personal account.

## Finding Your Team ID

You can find your team ID in two ways:

**Via CLI:**

```bash theme={null}
prime teams list
```

**Via Web:**
Visit your [Team Profile page](https://app.primeintellect.ai/dashboard/team-profile)

## Setting Team ID

<Warning>
  The `prime config set-team-id` command only affects CLI operations. For direct API usage (OpenAI client or HTTP requests), you must explicitly pass the `X-Prime-Team-ID` header.
</Warning>

### CLI Usage

When using the Prime CLI, configure your team ID once:

```bash theme={null}
# Set team ID for CLI operations
prime config set-team-id

# Verify configuration
prime config view

# Now CLI commands use team account
prime inference models
prime env eval gsm8k -m meta-llama/llama-3.1-70b-instruct -n 25
```

### API Usage

For direct API access, include the `X-Prime-Team-ID` header in your requests.

#### Option 1: Set as Default Header (Recommended)

Set the header once when creating the client:

<CodeGroup>
  ```python Python theme={null}
  import openai
  import os

  client = openai.OpenAI(
      api_key=os.environ.get("PRIME_API_KEY"),
      base_url="https://api.pinference.ai/api/v1",
      default_headers={
          "X-Prime-Team-ID": "your-team-id-here"
      }
  )

  # All requests will now use team account
  response = client.chat.completions.create(
      model="meta-llama/llama-3.1-70b-instruct",
      messages=[{"role": "user", "content": "Hello"}]
  )
  ```

  ```bash cURL theme={null}
  # Include header in every request
  curl -X POST https://api.pinference.ai/api/v1/chat/completions \
    -H "Authorization: Bearer $PRIME_API_KEY" \
    -H "X-Prime-Team-ID: your-team-id-here" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "meta-llama/llama-3.1-70b-instruct",
      "messages": [{"role": "user", "content": "Hello"}]
    }'
  ```

  ```javascript JavaScript theme={null}
  const client = {
    apiKey: process.env.PRIME_API_KEY,
    baseUrl: 'https://api.pinference.ai/api/v1',
    teamId: 'your-team-id-here'
  };

  const response = await fetch(`${client.baseUrl}/chat/completions`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${client.apiKey}`,
      'X-Prime-Team-ID': client.teamId,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      model: 'meta-llama/llama-3.1-70b-instruct',
      messages: [{ role: 'user', content: 'Hello' }]
    })
  });
  ```
</CodeGroup>

#### Option 2: Set Per Request

For occasional team usage or switching between accounts:

```python Python theme={null}
# Create client without team ID
client = openai.OpenAI(
    api_key=os.environ.get("PRIME_API_KEY"),
    base_url="https://api.pinference.ai/api/v1"
)

# Add team ID to specific requests
response = client.chat.completions.create(
    model="meta-llama/llama-3.1-70b-instruct",
    messages=[{"role": "user", "content": "Hello"}],
    extra_headers={
        "X-Prime-Team-ID": "your-team-id-here"
    }
)
```
