Skip to main content
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

string
required
Description of the code to generate.
string
Target programming language (e.g., "typescript", "python", "go", "rust"). Appended as a hint to the engine.
string
Target framework (e.g., "express", "nextjs", "fastapi", "gin"). Appended as a hint to the engine.

Request Examples

Response

string
Unique code generation ID (prefixed code_).
string
ISO 8601 timestamp.
string
The generated code as text.
object[]
Any files created during generation (e.g., multi-file outputs).
object[]
Tools invoked during code generation.
object

Example Response

Errors