| 1 | # API Usage |
| 2 | |
| 3 | Pixelle-Video provides a complete Python API for easy integration into your projects. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## Quick Start |
| 8 | |
| 9 | ```python |
| 10 | from pixelle_video.service import PixelleVideoCore |
| 11 | import asyncio |
| 12 | |
| 13 | async def main(): |
| 14 | # Initialize |
| 15 | pixelle = PixelleVideoCore() |
| 16 | await pixelle.initialize() |
| 17 | |
| 18 | # Generate video |
| 19 | result = await pixelle.generate_video( |
| 20 | text="Why develop a reading habit", |
| 21 | mode="generate", |
| 22 | n_scenes=5 |
| 23 | ) |
| 24 | |
| 25 | print(f"Video generated: {result.video_path}") |
| 26 | |
| 27 | # Run |
| 28 | asyncio.run(main()) |
| 29 | ``` |
| 30 | |
| 31 | --- |
| 32 | |
| 33 | ## API Reference |
| 34 | |
| 35 | For detailed API documentation, see [API Overview](../reference/api-overview.md). |
| 36 | |
| 37 | --- |
| 38 | |
| 39 | ## Examples |
| 40 | |
| 41 | For more usage examples, check the `examples/` directory in the project. |
| 42 | |
| 43 |