Skip to main content
Animus’s text generation capabilities let you create human-like text for a wide range of applications. This guide covers the fundamentals of generating text with our REST API.

Quickstart

To generate text with Animus, you’ll make a request to our chat completions endpoint. Here’s a basic example using direct API calls:

Advanced Usage

Message Roles and Names

When sending messages to the chat completions API, you can use different roles to structure your conversation:
  • system: Provides guidance to the model on how to behave
  • user: Represents user inputs in the conversation
  • assistant: Represents previous responses from the model
Additionally, you can use the name parameter to give a specific identity to user or assistant messages. This is useful for multi-agent simulations or distinguishing between different participants in a conversation:
The name parameter must be a string that adheres to the following regex pattern: ^[a-zA-Z0-9_-]{1,64}$. That means it can contain alphanumeric characters, underscores, and hyphens, with a maximum length of 64 characters.

Controlling Response Format

You can control the format of the responses by providing specific instructions in the system or user messages:

Temperature and Top P

Control the randomness and creativity of responses with these parameters:
  • temperature: (0-2) Lower values make output more deterministic; higher values make output more random
  • top_p: (0-1) Controls diversity via nucleus sampling

Maximum Tokens

Limit the length of the response by setting a maximum token count:

Streaming Responses

For a more interactive experience, you can stream responses as they’re generated:

Prompt Engineering Best Practices

For better results:
  1. Be specific: Provide clear instructions with examples
  2. Use system messages: Set the tone and behavior of the model
  3. Structure your prompts: Break complex tasks into smaller steps
  4. Context matters: Provide relevant background information
  5. Iterate and refine: Test different prompts and learn what works best

Common Use Cases

Animus’s text generation can be used for:
  • Content Creation: Generate articles, blog posts, or marketing copy
  • Conversational AI: Build chatbots and virtual assistants
  • Code Generation: Get help with programming tasks
  • Summarization: Condense long texts into concise summaries
  • Translation: Convert text between languages
  • Creative Writing: Generate stories, poems, or scripts

Error Handling

Implement robust error handling in your applications:

Next Steps

Vision

Learn how to analyze images and videos with the REST API

Moderation

Implement content moderation in your applications

Webhooks

Set up webhooks for real-time notifications

API Reference

Complete API documentation and reference