{"id":24557,"library":"scaleapi","title":"Scale AI Python Client","description":"The official Python client library for Scale AI, the Data Platform for AI. Provides programmatic access to Scale's APIs for creating tasks, managing batches, datasets, and more. Current version is 2.18.4, with active development and a new v2 API client. Release cadence is roughly monthly.","status":"active","version":"2.18.4","language":"python","source_language":"en","source_url":"https://github.com/scaleapi/scaleapi-python-client","tags":["scaleai","api-client","data-annotation","machine-learning","v2-api"],"install":[{"cmd":"pip install scaleapi","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false},{"reason":"Date parsing","package":"python-dateutil","optional":false},{"reason":"HTTP connection pooling","package":"urllib3","optional":false}],"imports":[{"note":"The SDK does not provide a direct 'client' import. Use 'scaleapi.ScaleClient'.","wrong":"from scaleapi import client","symbol":"ScaleClient","correct":"import scaleapi\nclient = scaleapi.ScaleClient('api_key')"},{"note":"Common alias is fine, but be careful not to shadow built-in.","wrong":"from scaleapi import ScaleClient as Client","symbol":"ScaleClient","correct":"from scaleapi import ScaleClient\nclient = ScaleClient('api_key')"}],"quickstart":{"code":"import os\nimport scaleapi\n\napi_key = os.environ.get('SCALE_API_KEY', '')\nclient = scaleapi.ScaleClient(api_key)\n\n# List your projects\nfor project in client.get_projects():\n    print(project.name, project.type)","lang":"python","description":"Initialize client with API key from environment variable and list projects."},"warnings":[{"fix":"Upgrade Python to 3.8 or later.","message":"Starting v2.16.0, Python 3.7 support is dropped. Requires Python >= 3.8.","severity":"breaking","affected_versions":">=2.16.0"},{"fix":"Check the v2 API docs: https://docs.genai.scale.com/v2.","message":"The v2 client (client.v2) uses different methods than the v1 client. For example, create_task is not available under v2; use v2_create_task or the respective v2 endpoint.","severity":"gotcha","affected_versions":">=2.16.0"},{"fix":"Use 'client.get_tasks(project_name=..., batch_name=..., limit=..., offset=...)' or 'client.v2.get_tasks(...)'.","message":"The method 'get_tasks' without pagination helper is deprecated. Use 'get_tasks' with parameters or 'v2.get_tasks' for paginated results.","severity":"deprecated","affected_versions":">=2.16.0"},{"fix":"Ensure the environment variable is set and non-empty. For local testing, set SCALE_API_KEY explicitly.","message":"API key must be passed as a string. Passing None or empty string gives a 401 Unauthorized error on first request.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install --upgrade scaleapi' and then use 'import scaleapi; client = scaleapi.ScaleClient(...)'.","cause":"The module scaleapi may be outdated or installed incorrectly. Check that the package is installed and you're using the correct import path.","error":"ImportError: cannot import name 'ScaleClient' from 'scaleapi'"},{"fix":"Set the SCALE_API_KEY environment variable to a valid Scale API key. Generate a new key if needed.","cause":"API key is invalid, missing, or expired.","error":"scaleapi.exceptions.ScaleUnauthorized: 401 Client Error: Unauthorized for url: https://api.scale.com/v1/projects"},{"fix":"Use 'scaleapi.ScaleClient(api_key)' to create a client instance.","cause":"The user tried to call 'scaleapi()' instead of 'scaleapi.ScaleClient()'.","error":"TypeError: 'module' object is not callable"},{"fix":"Upgrade to scaleapi >= 2.16.0 with 'pip install --upgrade scaleapi'.","cause":"You are using a version older than 2.16.0 which does not have the v2 client.","error":"AttributeError: module 'scaleapi' has no attribute 'v2'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}