Integrate our AI characters with authentic local knowledge into your applications
The Nyata AI API allows you to integrate our AI characters with authentic local knowledge into your applications. This enables your users to access personalized information, build conversation streaks, and earn rewards.
All API requests should be made to the following base URL:
The API uses standard HTTP response codes to indicate the success or failure of requests. Generally, codes in the 2xx range indicate success, codes in the 4xx range indicate an error in the request parameters, and codes in the 5xx range indicate a server error.
To access the Nyata AI API, you need an API key. You can obtain an API key by signing up for a developer account on our Developer Portal.
Include your API key in the Authorization header of all requests:
Keep your API key secure. Do not share it publicly, include it in client-side code, or commit it to version control systems.
To ensure fair usage, the API has rate limits based on your subscription tier.
Plan | Rate Limit | Burst Limit |
---|---|---|
Free | 60 requests per minute | 100 requests |
Standard | 300 requests per minute | 500 requests |
Premium | 600 requests per minute | 1000 requests |
Rate limit information is included in the response headers:
Use these endpoints to access information about our AI characters, their features, and capabilities.
Returns a list of all available AI characters on the platform. Results can be filtered by category.
Parameter | Type | Description |
---|---|---|
category | string (optional) | Filter characters by category. Options: professional, education, wellness, creative |
limit | integer (optional) | Maximum number of results to return. Default: 20 |
offset | integer (optional) | Number of results to skip. Default: 0 |
Returns detailed information about a specific character, including their skills, features, and personality traits.
Parameter | Type | Description |
---|---|---|
character_id | string (required) | The unique identifier of the character |
These endpoints allow you to create and manage conversations with Nyata AI characters, building conversation streaks and earning rewards.
Creates a new conversation with a specified character and returns an initial greeting message.
Parameter | Type | Description |
---|---|---|
character_id | string (required) | The ID of the character to converse with |
user_id | string (required) | The ID of the user starting the conversation |
initial_context | object (optional) | Additional context to help the character understand user needs |
Sends a user message to an ongoing conversation and updates streak progress.
Parameter | Type | Description |
---|---|---|
conversation_id | string (required) | The ID of the conversation |
Gets the AI character's response to the latest user message, personalized based on conversation history.
Parameter | Type | Description |
---|---|---|
conversation_id | string (required) | The ID of the conversation |
These endpoints provide access to user streak information, rewards, and progress tracking.
Retrieve information about a user's conversation streaks and available rewards.
Parameter | Type | Description |
---|---|---|
user_id | string (required) | The ID of the user |
Redeem an available streak reward for the user.
Parameter | Type | Description |
---|---|---|
user_id | string (required) | The ID of the user |
reward_id | string (required) | The ID of the reward to redeem |
These endpoints allow you to manage user accounts and preferences.
Create a new user account in the Nyata AI system.
Update a user's preferences including favorite characters and communication preferences.
Parameter | Type | Description |
---|---|---|
user_id | string (required) | The ID of the user |
We provide official SDKs for multiple programming languages to make integrating with our API easier.
Language | Package Manager | Install Command |
---|---|---|
JavaScript/TypeScript | npm | npm install nyata-ai |
Python | pip | pip install nyata-ai |
Ruby | gem | gem install nyata-ai |
PHP | composer | composer require nyata/nyata-ai |
For detailed documentation and example code for each SDK, visit our GitHub repositories.
Webhooks allow you to receive real-time notifications when specific events occur in the Nyata AI system.
Configure a webhook to receive event notifications.
Need help with integrating our API? We're here to help!
If you encounter any issues or have questions about our API, you can: