{"id":23190,"library":"youdotcom","title":"You.com Python SDK","description":"The official Python SDK for You.com, providing access to You.com's AI chat, code generation, and search APIs. Current version 2.3.0, requires Python >=3.10. Follows monthly release cadence.","status":"active","version":"2.3.0","language":"python","source_language":"en","source_url":"https://github.com/YouHQ/youdotcom","tags":["you.com","ai","sdk","chat","api"],"install":[{"cmd":"pip install youdotcom","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client for API calls","package":"httpx","optional":false},{"reason":"Data validation and settings management","package":"pydantic","optional":false},{"reason":"Compatibility with OpenAI-style chat completions","package":"openai","optional":true}],"imports":[{"note":"In v2.x, the main client is directly under youdotcom. The api submodule was removed in v2.0.","wrong":"from youdotcom.api import YouClient","symbol":"YouClient","correct":"from youdotcom import YouClient"},{"note":"Models are now exported at package level, not from a models submodule (changed in v2.0).","wrong":"from youdotcom.models import ChatCompletion","symbol":"ChatCompletion","correct":"from youdotcom import ChatCompletion"},{"note":"Async client is exported at package level since v2.0.","wrong":"from youdotcom.async_client import AsyncYouClient","symbol":"AsyncYouClient","correct":"from youdotcom import AsyncYouClient"}],"quickstart":{"code":"import os\nfrom youdotcom import YouClient\n\nclient = YouClient(api_key=os.environ.get('YOU_API_KEY', ''))\nresponse = client.chat.completions.create(\n    model='gpt-4',\n    messages=[{'role': 'user', 'content': 'Hello, how are you?'}]\n)\nprint(response.choices[0].message.content)","lang":"python","description":"Initialize the client with an API key and make a simple chat request."},"warnings":[{"fix":"Require Python 3.10+ and upgrade youdotcom to latest.","message":"In v2.0, the SDK dropped support for Python 3.9 and below. Upgrade to Python >=3.10.","severity":"breaking","affected_versions":"<=2.0.0"},{"fix":"Use `from youdotcom import YouClient, ChatCompletion` instead of old submodule imports.","message":"Import paths changed in v2.0. YouClient and models are now directly under `youdotcom`, not `youdotcom.api` or `youdotcom.models`.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Always specify a model string, e.g., `model='gpt-4'`.","message":"The method `youclient.chat.completions.create` now requires explicit `model` parameter; default model is deprecated and will be removed.","severity":"deprecated","affected_versions":">=2.2.0"},{"fix":"Use `YouClient(api_key='your-key')` or export `YOU_API_KEY`.","message":"API key must be set via environment variable `YOU_API_KEY` or passed directly. SDK does not read from .env automatically.","severity":"gotcha","affected_versions":"all"},{"fix":"Create an httpx.AsyncClient with desired settings and pass it as `http_client` parameter to YouClient/AsyncYouClient.","message":"The SDK uses httpx internally; proxies and custom timeouts must be configured via httpx client options, not directly on YouClient.","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":"Use `from youdotcom import YouClient` instead.","cause":"Import path changed in v2.0; youdotcom.api no longer exists.","error":"ModuleNotFoundError: No module named 'youdotcom.api'"},{"fix":"Upgrade to v2.3.0 which supports `YouClient(api_key='...')`. If using older version, set env var YOU_API_KEY.","cause":"Older SDK expected api_key as positional argument or via env var only.","error":"TypeError: __init__() got an unexpected keyword argument 'api_key'"},{"fix":"Ensure you are using YouClient (not other clients) and version >=2.0.","cause":"Trying to access chat endpoint on a non-chat client or older version.","error":"AttributeError: 'YouClient' object has no attribute 'chat'"},{"fix":"Set environment variable `YOU_API_KEY` or pass `api_key` to YouClient constructor.","cause":"Missing API key.","error":"ValueError: API key not provided. Set YOU_API_KEY environment variable."},{"fix":"Add `model='gpt-4'` (or similar) to the create method call.","cause":"model parameter is required since v2.2.0+.","error":"pydantic.error_wrappers.ValidationError: 1 validation error for ChatCompletionRequest\nmodel\n  field required (type=value_error.missing)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}