Fichas
Los tokens son las unidades fundamentales utilizadas por NovaAI para procesar texto. Cada solicitud y respuesta se mide en tokens, lo que afecta directamente a los límites de contexto, la longitud de la respuesta, el tiempo de procesamiento y la facturación. Comprender cómo funcionan los tokens le ayuda a crear aplicaciones de IA más rápidas, eficientes y rentables.
What Are Tokens?
Before a model can understand text, it breaks the input into smaller pieces called tokens. Tokens are not the same as words - depending on the language and formatting, a single word may consist of one or more tokens.
Both the text you send to the model and the text generated by the model contribute to the total number of tokens processed in a request.
How Tokens Are Used
Every API request consists of three token categories.
Token Type | Description |
|---|---|
Input Tokens | Tokens contained in your prompt, instructions, and conversation history. |
Output Tokens | Tokens generated by the model in its response. |
Total Tokens | The combined number of input and output tokens processed during the request. |
Request Breakdown
Every piece of text sent to the model contributes to the total token count.
Example Usage
NovaAI returns token usage with every successful response, allowing you to monitor consumption and optimize your application.
Understanding Usage Statistics
Property | Description |
| Tokens used by the request payload. |
| Tokens generated by the model. |
| Combined total for the request. |
Token Lifecycle
Before processing begins, the model converts both your request and response into tokens.
Context Window
Every model has a maximum context window, which represents the total number of tokens it can process in a single request.
The context window includes:
System instructions
Conversation history
User messages
Generated response
Once the limit is reached, older context may need to be removed or summarized.
Estimated Token Consumption
Content | Approximate Tokens |
Short sentence | 10–20 |
Paragraph | 80–150 |
Blog article | 700–1,500 |
Source code (100 lines) | 600–1,200 |
Long conversation | 2,000+ |
These values are estimates and may vary depending on formatting and language.
Optimizing Token Usage
Keep prompts concise and focused.
Remove unnecessary conversation history.
Summarize older messages instead of sending the full conversation.
Set an appropriate
max_tokensvalue.Choose the right model for your workload.
Avoid sending duplicate context in every request.
Common Questions
Token Optimization Checklist
Keep prompts as short as possible.
Send only relevant conversation history.
Monitor token usage in API responses.
Set sensible output limits.
Review high-usage requests regularly.
Next Step
Now that you understand how tokens influence performance, context, and cost, continue to Responses to learn how NovaAI structures API responses and returns generated content to your application.