Text Completion

Input: "The future of artificial intelligence will"
Output: "revolutionize how we work, learn, and interact with technology. AI will become an integral part of daily life, enhancing human capabilities rather than replacing them, leading to unprecedented innovations in healthcare, education, and scientific research."
const response = await codex.completions.create({
  prompt: "The future of artificial intelligence will",
  max_tokens: 50,
  temperature: 0.7
});

Code Generation

Input: "Create a Python function to sort a list"
Output:
def sort_list(items, reverse=False):
    """
    Sort a list of items in ascending or descending order.
    
    Args:
        items (list): The list to be sorted
        reverse (bool): If True, sort in descending order
    
    Returns:
        list: A new sorted list
    """
    return sorted(items, reverse=reverse)

Conversation AI

User: "Explain machine learning like I'm five years old"
AI: "Imagine you're teaching a robot to recognize different animals. You show the robot thousands of pictures of cats and dogs, telling it which is which. After seeing many examples, the robot gets really good at telling cats from dogs in new pictures! That's what machine learning is - teaching computers to learn patterns from examples, just like how you learned to recognize animals when you were little."

Creative Writing

Input: "Write a short poem about coding"
Output:
Lines of logic dance on screen,
Variables whisper what they mean,
Functions call and loops repeat,
Making algorithms complete.

In this digital symphony,
Code becomes poetry.

Code Review

Input: "Review this JavaScript function for improvements"
Output: "The function looks good overall! Here are some suggestions: 1) Add input validation to handle edge cases, 2) Consider using more descriptive variable names, 3) Add JSDoc comments for better documentation, 4) You might want to handle potential null/undefined values before processing."

Data Analysis

Input: "Analyze this sales data and provide insights"
Output: "Based on the sales data analysis: 1) Q4 showed 23% growth compared to Q3, 2) Mobile sales increased by 45%, indicating strong mobile adoption, 3) Customer retention improved by 12%, 4) Recommendation: Focus marketing efforts on mobile platforms and enhance customer loyalty programs."

Ready to Build Your Own?

Start experimenting with these examples in our interactive playground

Open Playground