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

# Authentication

Scale uses HTTP Bearer Authentication to authenticate all API calls to our platform. Provide your **API Key** as the Bearer Authorization header.

```python ScaleSDK theme={null}
import scaleapi

API_KEY = 'live_...'
client = scaleapi.ScaleClient(API_KEY)
```

```bash cURL {4} theme={null}
API_KEY='live_...'
curl --request GET \
    --url 'https://api.scale.com/v2/tasks?project_name=My+Test+Project&limit=1' \
    --header "Authorization: Bearer $API_KEY"
```

```python Python {10} theme={null}
import requests

API_KEY = 'live_...'

response = requests.request(
  "GET",
  url="https://api.scale.com/v2/tasks",
  headers={
    "Accept": "application/json",
    "Authorization": f"Bearer {API_KEY}",
  },
  params={"project_name": "My Test Project", "limit": "1"},
)
print(response.json())
```

```javascript JavaScript {8} theme={null}
const API_KEY = 'live_...';
const params = new URLSearchParams({ task_id: 'abc123' });

const response = await fetch('https://api.scale.com/v2/task?' + params.toString(), {
  method: 'GET',
  headers: {
    Accept: 'application/json',
    Authorization: `Bearer ${API_KEY}`,
  },
});
console.log(await response.json());
```

```go Go {9} theme={null}
func main() {
  apiKey := "live_..."
  taskId := "abc123"

  url := fmt.Sprintf("https://api.scale.com/v2/task?task_id=%s", taskId)

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", apiKey))

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(string(body))
}
```

```java Java {9} theme={null}
public class App {
    public static void main(String[] args) {
        String apiKey = "live_...";
        String taskId = "abc123";

        String url = String.format("https://api.scale.com/v2/task?task_id=%s", taskId);

        HttpResponse<String> response = Unirest.get(url)
          .header("Authorization", String.format("Bearer %s", apiKey))
          .asString();

        System.out.println(response.getBody());
    }
}
```

### Getting your API key

Your API keys are conveniently located in your [dashboard](https://dashboard.scale.com/settings/apikey). Access to your dashboard is gained by [logging in](https://dashboard.scale.com/login) to your existing account.
Once you're in, navigate to your profile and select 'API Key' from the menu.

Your "Live API Key" should start with `live_`

### Don't see the "API Keys" section?

Only Admins and Managers have access to API Keys for your security. You can either ask your admin head over to [Team Page](https://dashboard.scale.com/settings/team) and update your [role](https://scale.com/docs/team-getting-started) to be a "Manager", or share the API key with you.
