Skip to main content

Code Generator

Generate code and programming solutions using various AI models through the 1min.AI API. This endpoint helps you create code snippets, complete functions, and get programming solutions for different languages and frameworks.

Available Models

Loading available models...

Request Parameters

All models share the same request structure:

Field NameTypeSupported ValueDescriptionRequired
typetextCODE_GENERATORFeature name✔️
modeltextSee available modelsModel identifier✔️
conversationIdtextCODE_GENERATORConversation ID✔️
promptObject.promptstringAny textCode generation prompt✔️
promptObject.webSearchbooleantrue, falseEnable web search for additional context
promptObject.numOfSitenumber1-10Number of websites to search❌*
promptObject.maxWordnumber100-10000Maximum words per website❌*

Endpoint

Request Headers

FieldValue
API-KEY<api-key>
Content-Typeapplication/json

Code Example

curl --location 'https://api.1min.ai/api/features' \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"type": "CODE_GENERATOR",
"model": "gpt-4o",
"conversationId": "CODE_GENERATOR",
"promptObject": {
"prompt": "Create a Python function to calculate the factorial of a number recursively",
"webSearch": false
}
}'

Interactive Playground

Try the API directly in your browser:

Loading interactive playground...

Response Format

{}