Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

Query Parameters

Learn how to configure chat conversations using URL query parameters in LibreChat. Set models, endpoints, and conversation settings dynamically.

LibreChat can configure a chat conversation directly from the URL. Append query parameters to a chat path to choose the endpoint and model, pre-fill the input, or override conversation settings before the chat loads.

Chat Paths

Query parameters must follow a valid chat path:

  • New conversations: /c/new?
  • Existing conversations: /c/[conversation-id]? (where conversation-id is an existing one)
https://your-domain.com/c/new?endpoint=ollama&model=llama3%3Alatest
https://your-domain.com/c/03debefd-6a50-438a-904d-1a806f82aad4?endpoint=openAI&model=o1-mini

Basic Usage

The endpoint and model parameters cover most cases. Set both for predictable results:

https://your-domain.com/c/new?endpoint=azureOpenAI&model=o1-mini

Endpoint selection

Use endpoint on its own to switch endpoints without naming a model:

https://your-domain.com/c/new?endpoint=google

When only endpoint is set, LibreChat falls back to the last model selected for that endpoint (from localStorage). If there is no previous selection, it uses the first model in the endpoint's list.

The endpoint value must be one of:

openAI, azureOpenAI, google, anthropic, assistants, azureAssistants, bedrock, agents

For a custom endpoint, use its configured name as the value (case-insensitive):

# endpoint=perplexity for a custom endpoint named `Perplexity`
https://your-domain.com/c/new?endpoint=perplexity&model=llama-3.1-sonar-small-128k-online

Model selection

Use model on its own to switch models within the current endpoint:

https://your-domain.com/c/new?model=gpt-4o

When only model is set, LibreChat applies it only if the model exists in the current endpoint. The current endpoint is the default endpoint or the last one selected.

Prompt

The prompt parameter pre-populates the chat input:

https://your-domain.com/c/new?prompt=Explain quantum computing

q is an interchangeable shorthand for prompt:

https://your-domain.com/c/new?q=Explain quantum computing

Combine it with other parameters:

https://your-domain.com/c/new?endpoint=anthropic&model=claude-3-5-sonnet-20241022&prompt=Explain quantum computing

Automatic submission

Add submit=true to send the prompt automatically, without manual confirmation:

https://your-domain.com/c/new?prompt=Explain quantum computing&submit=true

This is useful for automated workflows (Raycast, Alfred, Automator) and external integrations. Combine it with the other parameters for a fully scripted launch:

https://your-domain.com/c/new?endpoint=openAI&model=gpt-4&prompt=Explain quantum computing&submit=true

URL Encoding

Special characters in query values must be URL-encoded. Common substitutions:

CharacterEncoded
:%3A
/%2F
?%3F
#%23
&%26
=%3D
+%2B
Space%20 (or +)

For example:

Original: `Write a function: def hello()`
Encoded: `/c/new?prompt=Write%20a%20function%3A%20def%20hello()`

JavaScript's built-in encodeURIComponent() handles the encoding for you:

const prompt = "Write a function: def hello()";
const encodedPrompt = encodeURIComponent(prompt);
const url = `/c/new?prompt=${encodedPrompt}`;
console.log(url);

Run this in your browser console (Ctrl+Shift+I) to see the encoded URL.

Specs, Agents, and Assistants

Model specs

Select a model spec by name:

https://your-domain.com/c/new?spec=meeting-notes-gpt4

This loads every setting defined by the spec. Other model parameters in the URL are ignored when spec is present.

Agents

Load an agent by ID without naming an endpoint:

https://your-domain.com/c/new?agent_id=your-agent-id

This sets the endpoint to agents automatically.

Assistants

Load an assistant by ID the same way:

https://your-domain.com/c/new?assistant_id=your-assistant-id

This sets the endpoint to assistants automatically.

Supported Parameters

LibreChat settings

ParameterDescription
maxContextTokensOverride the system-defined context window.
resendFilesControl file resubmission in subsequent messages.
promptPrefixSet custom instructions / system message.
imageDetailImage quality: low, auto, or high. Applies only to OpenAI, OpenAI-like custom endpoints, and Azure OpenAI (defaults to auto).
specSelect a model spec by exact name. When set, other model parameters are ignored in favor of the spec. If specs are configured with enforce: true, this parameter may be required for URL query params to work.
fileTokenLimitMaximum token limit for file processing, to control cost and resource usage. The request value overrides the YAML default.

Model parameters

Supported model parameters vary by endpoint. Values must be valid according to the provider's API.

OpenAI, Custom, Azure OpenAI:

temperature, presence_penalty, frequency_penalty, stop, top_p, max_tokens,
reasoning_effort, reasoning_summary, verbosity, useResponsesApi, web_search, disableStreaming

Google, Anthropic:

topP, topK, maxOutputTokens, thinking, thinkingBudget, thinkingLevel, web_search, url_context

For Google endpoints, set url_context=true to let supported Gemini text models read URLs included in the user message. YouTube URLs are handled with native video understanding when URL Context is enabled.

Anthropic, Bedrock (Anthropic models), OpenRouter custom endpoints:

Set promptCache to true or false to toggle prompt caching. Set promptCacheTtl to 5m or 1h to choose the cache lifetime when prompt caching is enabled:

promptCache
promptCacheTtl=1h

See the Anthropic prompt caching docs and the Bedrock prompt caching docs for details.

Bedrock:

# Bedrock region
region=us-west-2
# Bedrock equivalent of `max_tokens`
maxTokens=200
# Bedrock reasoning effort (for supported models like ZAI, MoonshotAI)
reasoning_effort=medium

Assistants / Azure Assistants:

# Overrides existing assistant instructions for the current run
instructions=your+instructions
# Adds the current date and time to `additional_instructions` for each run
append_current_datetime=true

Most of these parameters are shared with Model Spec Preset Fields; refer there for the full reference.

Examples

Multiple parameters in one URL:

https://your-domain.com/c/new?endpoint=google&model=gemini-2.0-flash-exp&temperature=0.7&prompt=Oh hi mark

Loading a model spec with a prompt:

https://your-domain.com/c/new?spec=meeting-notes-gpt4&prompt=Here%20is%20the%20transcript...

When using spec, other model parameters are ignored in favor of the spec's configuration.

Validation

All parameters are validated against LibreChat's schema before they are applied. Invalid parameters and values are ignored; valid settings are applied to the conversation.

Use query parameters carefully

  • Misuse or exceeding provider limits can produce API errors.
  • If you hit a bad request error, reset the conversation by clicking New Chat.
  • A parameter has no effect if the selected endpoint does not support it.

Best Practices

  1. Set both endpoint and model whenever possible.
  2. Confirm the endpoint supports each parameter you pass.
  3. Keep values within the provider's limits.
  4. Test parameter combinations before sharing URLs.

Query parameters make it easy to share specific conversation configurations, bookmark different chat setups, and automate chat startup from external tools.

How is this guide?