State

Get current state settings

When called without query parameters this returns the master/app state for the API key/app. To retrieve a specific user's state, provide ?user={userId}.

get/v1/state

Request

  • Base URL: https://apipie.ai
  • URL: https://apipie.ai/v1/state
  • Auth: one of:
    • HTTP bearer
    • API key in header x-api-key

Query parameters

userstring

Optional. If provided, returns the state for the specified user. If omitted, returns the app-level (master) state for the current API key/app.

app_namestring

Optional. Enables the ablity for centralized APIkey state management for enterprises.

Response

Current state (app-level or user-level)

scope'user' | 'app'
keystring

user (when user scope) or app label (when app scope)

enable_inline_cliboolean

Whether inline CLI is enabled for this state

gui_onlyboolean

When true, state configuration can only be performed through the APIpie GUI and cannot be edited via API or inline cli. Needs to be app scoped (disable user_states).

Example response

{
  "settings": {
    "anon": true,
    "max_tokens": 300,
    "memory": true,
    "mem_session": "user123-sessionA",
    "mem_expire": 1440,
    "integrity": 12,
    "model": "openai/gpt-4o-mini",
    "shortMem": 3,
    "longMem": 2,
    "routing": "perf",
    "tools_model": "gpt-4o-mini",
    "user": "user487",
    "tool_choice": "auto",
    "vector_provider": "pinecone",
    "search_whitelist": [
      "apnews.com",
      "bbc.com",
      "reuters.com"
    ],
    "search_blacklist": [
      "cnn.com",
      "foxnews.com"
    ],
    "temperature": 1,
    "top_p": 1,
    "web_search_options": {
      "search_context_size": "medium"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.