Media Generation
Generate Code
Generate production-quality code using the Theo Code engine.
POST
Generate Code
Generate code from a natural language prompt. The Theo Code engine is optimized for production-quality code and long-form output.
Authentication
Requires a Bearer token. See Authentication.Request Body
Description of the code to generate.
Target programming language (e.g.,
"typescript", "python", "go", "rust"). Appended as a hint to the engine.Target framework (e.g.,
"express", "nextjs", "fastapi", "gin"). Appended as a hint to the engine.Request Examples
Response
Unique code generation ID (prefixed
code_).ISO 8601 timestamp.
The generated code as text.
Any files created during generation (e.g., multi-file outputs).
Tools invoked during code generation.
Example Response
Errors
| Status | Code | Description |
|---|---|---|
| 400 | missing_prompt | prompt is required |
| 401 | invalid_api_key | Missing or invalid API key |
| 429 | rate_limit_exceeded | Too many requests |
Generate Code
