{"id":34974577,"url":"https://github.com/techwithty/heygen-streaming-api","last_synced_at":"2026-04-27T14:03:51.903Z","repository":{"id":299636160,"uuid":"1003408017","full_name":"TechWithTy/heygen-streaming-api","owner":"TechWithTy","description":"Python client and FastAPI integration for HeyGen's Streaming API. Production-ready implementation with type hints, async support, and comprehensive error handling.","archived":false,"fork":false,"pushed_at":"2025-06-17T14:10:06.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-17T14:46:23.186Z","etag":null,"topics":["ai-avatars","api-client","async-io","fastapi","heygen","python","rest-api","streaming-api","video-generation","webhooks"],"latest_commit_sha":null,"homepage":"https://www.cybershoptech.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TechWithTy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-17T05:28:57.000Z","updated_at":"2025-06-17T14:12:17.000Z","dependencies_parsed_at":"2025-06-17T14:46:25.833Z","dependency_job_id":"4d4d7329-eb99-471e-8bb5-f7b63a5f640d","html_url":"https://github.com/TechWithTy/heygen-streaming-api","commit_stats":null,"previous_names":["techwithty/heygen-streaming-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TechWithTy/heygen-streaming-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fheygen-streaming-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fheygen-streaming-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fheygen-streaming-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fheygen-streaming-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechWithTy","download_url":"https://codeload.github.com/TechWithTy/heygen-streaming-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fheygen-streaming-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32339295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-avatars","api-client","async-io","fastapi","heygen","python","rest-api","streaming-api","video-generation","webhooks"],"created_at":"2025-12-26T23:59:48.447Z","updated_at":"2026-04-27T14:03:51.898Z","avatar_url":"https://github.com/TechWithTy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HeyGen Streaming SDK for Python\n\nAn asynchronous Python client for interacting with the HeyGen Streaming API, designed for high-performance and reliability.\n\n## Features\n\n- Full async/await support\n- Type hints throughout\n- Pydantic models for request/response validation\n- Environment-based configuration\n- Singleton client instance\n- Built-in error handling\n\n## Installation\n\n```bash\n# Using pip\npip install heygen-streaming-sdk\n\n# Using poetry\npoetry add heygen-streaming-sdk\n```\n\n## Configuration\n\nConfiguration is handled through environment variables. Create a `.env` file in your project root:\n\n```bash\nHEYGEN_API_KEY=your_api_key_here\nHEYGEN_BASE_URL=https://api.heygen.com/v1\nHEYGEN_TIMEOUT=30\n```\n\nOr set them in your environment:\n\n```bash\nexport HEYGEN_API_KEY=your_api_key_here\nexport HEYGEN_BASE_URL=https://api.heygen.com/v1\nexport HEYGEN_TIMEOUT=30\n```\n\n## Usage\n\n### Basic Usage\n\n```python\nfrom heygen_streaming import client\n\nasync def create_streaming_session():\n    # The client is a singleton, so you can import and use it directly\n    session = await client.create_session(\n        # Your session configuration here\n    )\n    return session\n```\n\n### Using with FastAPI\n\n```python\nfrom fastapi import FastAPI, Depends\nfrom heygen_streaming import client, config\n\napp = FastAPI()\n\n@app.get(\"/create-session\")\nasync def create_session():\n    \"\"\"Create a new streaming session.\"\"\"\n    try:\n        session = await client.create_session(\n            # Your session configuration here\n        )\n        return {\"session_id\": session.id}\n    except Exception as e:\n        return {\"error\": str(e)}, 500\n```\n\n## API Reference\n\n### `HeyGenStreamingClient`\n\nThe main client class for interacting with the HeyGen Streaming API.\n\n#### Methods\n\n- `create_session(request: NewSessionRequest) -\u003e NewSessionResponse`: Create a new streaming session.\n- `start()`: Initialize the HTTP client.\n- `close()`: Close the HTTP client.\n\n### Configuration\n\nConfiguration is available through the `config` object:\n\n```python\nfrom heygen_streaming.config import config\n\nprint(f\"Using API base URL: {config.BASE_URL}\")\n```\n\n## Error Handling\n\nThe SDK provides the following exceptions:\n\n- `HeyGenAPIError`: Base exception for all API errors\n- `AuthenticationError`: Raised for authentication failures\n- `ValidationError`: Raised for request/response validation failures\n\n## Development\n\n### Setup\n\n1. Clone the repository\n2. Install dependencies:\n   ```bash\n   poetry install\n   ```\n3. Create a `.env` file based on `.env.example`\n\n### Testing\n\nRun the test suite:\n\n```bash\npytest tests/\n```\n\n### Linting\n\n```bash\nruff check .\n```\n\n### Formatting\n\n```bash\nblack .\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechwithty%2Fheygen-streaming-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechwithty%2Fheygen-streaming-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechwithty%2Fheygen-streaming-api/lists"}