---
title: "Get current state settings"
method: GET
path: "/v1/state"
tags: ["State"]
---

# Get current state settings

`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`

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}`.

## Query parameters

- `user` string
- `app_name` string

## Response `200`

Current state (app-level or user-level)

- StateResponse
  - `scope` 'user' | 'app'
  - `key` string: user (when user scope) or app label (when app scope)
  - `settings` StateSettings: Settings persisted per user or per app (api key) depending on scope
    - `anon` boolean: When true, anonymizes sensitive data in chat completions before sending to AI models and de-anonymizes responses. Only applies to chat completion routes.
    - `max_tokens` integer: Max tokens used to generate a response to limit response size
    - `memory` true | false
    - `mem_session` string: Optional unique identifier for separate memory chains, otherwise uses "user"
    - `mem_expire` integer: Time in minutes before memory expires (expire from time of save)
    - `integrity` 11 | 12 | 13: Add mulitple response and best answer voting for a single hallucination free response
    - `model` string: Should be in form of provider/model
    - `search_lang` string: Alias for lang (kept for compatibility)
    - `search_geo` string: Alias for geo (kept for compatibility)
    - `shortMem` integer: Number of recent message pairs in short-term memory (max 10)
    - `longMem` integer: Number of individual messages to retrieve from long-term memory (max 10)
    - `routing` 'price' | 'perf' | 'perf_avg': Routing mode (price/perf/perf_avg)
    - `tools_model` string: If tools call, use this model for tools response, otherwise respond with selected model. openai/anthropic models only.
    - `user` string: Sets the user for completion calls when provided in settings. Not compatible with user scoped management.
    - `tool_choice` 'none' | 'auto' | 'required'
    - `vector_provider` 'pinecone' | 'qdrant': Select what vector backend to use for memory and ragTuning. (Only used at creation, must clear and recreate to change provider)
    - `search_whitelist` string[]: Array of root FQDNs to allow for AI search (e.g., ["apnews.com", "bbc.com", "reuters.com"]). If not provided/null, AI can use any URLs that searches present. Applies to all search-augmented completions. Backward compatible: strings (comma-delimited) are also accepted and will be converted to arrays.
    - `search_blacklist` string[]: Array of root FQDNs to block for AI search (e.g., ["cnn.com", "foxnews.com"]). If not provided/null, no URLs are blocked. Applies to all search-augmented completions. Backward compatible: strings (comma-delimited) are also accepted and will be converted to arrays.
    - `temperature` number: Influences the randomness in the selection process of the next token. Lower values make the model more deterministic, while higher values increase diversity but might reduce coherence.
    - `top_p` number: Controls the cumulative probability distribution cutoff, selecting the smallest set of tokens whose cumulative probability exceeds the threshold p. This focuses generation on more likely tokens, enhancing creativity and coherence.
    - `top_k` integer: Limits the selection pool to the top k most probable tokens. The probability distribution is then reranked among these k tokens, which helps in reducing randomness by eliminating the least likely options.
    - `frequency_penalty` number: Adjusts the likelihood of a token's selection based on its previous occurrences, decreasing the chances of frequently selected tokens to promote diversity in the output.
    - `presence_penalty` number: Similar to frequency penalty, but it decreases the likelihood of tokens appearing again based on their presence, regardless of frequency, to encourage novel token selection.
    - `web_search_options` object: Options for web search context size, can be set to low, medium, or high. Defaults to low. Overrides any settings for search, pull, use, and scrape length.
      - `search_context_size` 'low' | 'medium' | 'high'
  - `enable_inline_cli` boolean: Whether inline CLI is enabled for this state
  - `gui_only` boolean: 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).

---

[API](https://skmtc.dev/apipie/apis/introduction.md) · [All operations](https://skmtc.dev/apipie/apis/introduction/llms.txt) · [OpenAPI document](https://skmtc.dev/apipie/apis/introduction/revisions/f8386be4eb3f?raw)
