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

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

Request Examples

Response

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

Example Response

Errors