APIpie by Neuronic AI introduces the first-of-its-kind State Management system for AI applications — an innovation you won’t find anywhere else. Built directly into our platform, this feature empowers developers, enterprises, and even open-source projects to take full control of AI behavior at runtime, without rewriting a single line of code.
With APIpie State Management, every configuration — from model selection and memory settings to integrity controls, search integration, and even the system prompt — can be centrally managed, persisted, and enforced. Whether you’re sending queries through our OpenAI-compliant API, shaping behavior in real time with our Inline CLI, or governing application defaults through a visual dashboard, state becomes the backbone of flexible and scalable AI deployment.
The value is enormous:
This is not just convenience — it’s competitive advantage. With APIpie, businesses and builders can adapt faster, experiment freely, and push AI-driven products to market with confidence. Our State Management framework is the first of many industry firsts we’re bringing to the table, giving you an edge over competitors and empowering you to harness AI more effectively than ever before.
three powerful ways to manage state across applications, API keys, and users. Whether you need real-time control inside a prompt, programmatic management via API, or a visual interface, our platform ensures full flexibility.
/v1/state endpoint to programmatically create, update, or delete state for apps and or users.:setmodel:.The APIpie State Management GUI provides a visual interface for configuring and controlling state across apps and API keys. It’s designed for enterprises, teams, and developers who prefer a centralized, intuitive way to enforce AI settings without relying solely on API calls or inline CLI commands.
Each tab in the GUI corresponds to a configuration area — from general flags and model selection to fine-grained controls, memory management, and internet search behavior. On the right-hand side of the GUI, you’ll always see the Current Settings JSON, which shows the effective configuration that will override any incoming API call settings for this app or user scope.
API keys can be managed through the API-key interface
Click on "Manage" next to the API key you want to manage

The General tab provides high-level switches that control scope, governance, and CLI access.
true, every unique user value passed with this API key has its own isolated state. When false, the API key operates in app-scoped mode.user value when calling APIs with this key (not compatible with user-scoped management).
The Models tab allows you to define which AI model to use as the default for this state.
openai/gpt-5-chat-latest.
The Controls tab lets you fine-tune model generation parameters for creativity, coherence, and randomness.

The Memory tab manages both short-term and long-term AI memory.
customer-123-sessionA).This enables features like personalized conversations, tenant-specific persistence, or multi-session separation.

The Internet tab configures web search augmentation and content filters.
apnews.com, reuters.com).cnn.com, foxnews.com).These settings allow enterprises to enforce compliance, control bias in sources, and optimize retrieval quality.
Together, these GUI tabs give teams complete control over every aspect of AI behavior, while the Current Settings JSON ensures transparency by showing exactly what configuration is active. Whether you want flexibility for developers or governance for enterprises, the GUI provides a straightforward and powerful state management experience.
Developers can manage application or user state programmatically via the /v1/state endpoint. This provides fine-grained control over configuration, memory, and routing at both per-app and per-user levels.
State Management API REFERENCE
Authenticate using either:
Authorization: Bearer <YOUR_API_KEY>
x-api-key: <YOUR_API_KEY>
Retrieve the current state settings.
?user={userId} → returns user-specific state.?app_name={name} → supports centralized enterprise state management.curl -X GET "https://apipie.ai/v1/state" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"
Create or update state. Supports partial updates, key deletions, and toggling features.
curl -X POST "https://apipie.ai/v1/state" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"settings": {
"memory": false,
"model": "openai/gpt-4-1",
"search_lang": "en",
"search_geo": "us",
"shortMem": 10,
"routing": "price"
}
}'
Delete entire state records.
?user={userId} → deletes state for a user.curl -X DELETE "https://apipie.ai/v1/state" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"
curl -X POST "https://apipie.ai/v1/state" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"enable_inline_cli": false,
"settings": {}
}'
curl -X POST "https://apipie.ai/v1/state" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"settings": { "nlp": false },
"delete": ["routing"]
}'
curl -X POST "https://apipie.ai/v1/state" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"enable_user_states": true }'
All state responses return a consistent schema including scope, key, settings, and feature flags:
{
"scope": "app",
"key": "stateTest",
"settings": {
"memory": false,
"mem_session": "testState",
"model": "openai/gpt-4-1",
"search_lang": "en",
"search_geo": "us",
"shortMem": 10,
"longMem": 2,
"routing": "price"
},
"enable_inline_cli": true,
"gui_only": false
}
The Inline CLI provides real-time state control inside your prompt flow. This feature lets you configure and persist AI state with natural commands in the first or last 250 characters of any prompt.
Send :help in your prompt with your APIpie key in your favorite chat app to see all supported commands. This is the fastest way to explore available options.
The following example shows how to persistently set a model and then confirm the saved state with :getstate:
curl -X POST 'https://apipie.ai/v1/chat/completions' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{
"user": "12345",
"inline_cli": "all",
"messages": [
{ "role": "user", "content": ":setmodel:openai/gpt-4o :getstate" }
]
}'
This sets the model to OpenAI GPT-4o for all subsequent requests (until unset) and immediately returns all current state configuration for this user or app depending on if its scoped for app or user. Youc an do a lot more than jsut state management with our inline CLI, for example:
Inline CLI supports commands for:
:getstate):setmodel:openai/gpt-4o, :unsetmodel):becreative, :beprecise):setintegrity, :answersuperintegrity):setmemoryon, :clearmemory):search, :deepsearch)Learn more in the Inline CLI guide.
In addition to core configuration settings, APIpie State Management includes special control options that determine how state can be changed, who it applies to, and how it persists. These controls make state even more powerful and adaptable across different use cases.
The enable_inline_cli flag determines whether users can modify state directly from inside their prompts using the Inline CLI.
:setmodel:, :becreative, etc.).This toggle allows teams to decide how much flexibility to grant to end users.
The gui_only flag enforces that all state changes must be made in the APIpie dashboard.
This is especially useful for enterprises that need strict governance and want to ensure changes are audited and centrally managed.
Every state configuration is tied to a scope, which can be either app or user.
user value sent with that API key. Each user maintains their own isolated state, making this ideal for multi-tenant services where every end-user experience needs to be personalized.Important notes about scope behavior:
app to user (or vice versa) will clear all existing configurations.key field in a state record reflects the app_name or API key name defined when the key was created.These special controls — Inline CLI, GUI-only mode, and scoping — ensure that state management works not only as a configuration system but also as a flexible governance layer. Together, they give individuals freedom when needed and enterprises the ability to enforce structure when required.
APIpie by Neuronic AI delivers turnkey AI infrastructure for developers and enterprises. With Inline CLI for real-time prompt control, API for programmatic configuration, and GUI for enterprise governance, you can manage state seamlessly across apps, API keys, and users.
Start with Inline CLI (:help) or explore /v1/state for advanced control.
AI Voice: ElevenLabs & OpenAI TTS API Guide
Generate lifelike voices with our advanced text-to-speech API, featuring 30+ voices, multilingual support, and customizable options.
Preferred Routing: Optimize Cost or Performance
Optimize your AI requests with our Preferred Routing feature, allowing cost-efficient or fast performance routing. Start enhancing your operations today!