Skip to main content

Code Generator

The Code Generator API helps you generate code and programming solutions using various AI models. This feature supports multiple AI models to provide comprehensive code generation capabilities for different programming languages and frameworks.

Overview

The Code Generator API allows you to:

  • Generate code snippets and complete functions
  • Get programming solutions and explanations
  • Support multiple AI models for diverse coding approaches
  • Generate code for various programming languages
  • Enhance code generation with web search for additional context

Endpoint

Authentication

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

Supported Models

All models support the same parameters and functionality:

OpenAI Models

  • GPT-5 (gpt-5) - Latest GPT-5 model
  • GPT-5 Chat Latest (gpt-5-chat-latest) - Optimized for chat
  • GPT-4o (gpt-4o) - High-performance model

Anthropic Models

  • Claude 3.5 Haiku (claude-3-5-haiku-20241022) - Fast and efficient
  • Claude 3.5 Sonnet (claude-3-5-sonnet-20240620) - Balanced performance
  • Claude 3.7 Sonnet (claude-3-7-sonnet-20250219) - Latest Sonnet model

Deepseek Models

  • Deepseek Chat (deepseek-chat) - General chat model
  • Deepseek R1 (deepseek-reasoner) - Advanced reasoning model

Request Parameters

ParameterTypeSupported ValuesDescriptionRequired
typestringCODE_GENERATORFeature name✔️
modelstringSee supported models aboveModel identifier✔️
conversationIdstringCODE_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❌*

*Required when webSearch is true

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": "claude-3-5-sonnet-20240620",
"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:

API Playground

https://api.1min.ai/api/features
Choose the AI model for code generation
Identifier for the conversation context
Describe what code you want to generate
Enable web search for additional context and latest information

Generated cURL Command:

curl -X POST "https://api.1min.ai/api/features" \
-H "API-KEY: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"type": "CODE_GENERATOR",
"model": "claude-3-5-sonnet-20240620",
"conversationId": "CODE_GENERATOR",
"promptObject": {
"prompt": "Create a Python function to calculate the factorial of a number recursively",
"webSearch": false,
"numOfSite": 3,
"maxWord": 1000
}
}'

Response Format

{}