Skip to content

SOP 005: Custom Parameters

Fresh 🌱

Document ID: SOP-005
Version: 1.0
Status: Active

Objective

Pass custom parameters to Poe bots, including thinking budget, reasoning effort, and aspect ratios.

Prerequisites

  • [x] API key obtained (SOP 001)
  • [x] fastapi-poe installed (SOP 002)
  • Understanding of basic queries (SOP 003)

Important Note

Parameter Format

Parameters must be passed via the parameters attribute in ProtocolMessage, NOT appended to the message content string. Appending "--thinking_budget 1000" to content will NOT work.

Procedure

Step 1: Create Message with Parameters

Use the parameters dictionary:

python
message = fp.ProtocolMessage(
    role="user",
    content="Your question here",
    parameters={"parameter_name": "value"}
)

Step 2: Query Bot

python
for partial in fp.get_bot_response_sync(
    messages=[message],
    bot_name="Bot-Name",
    api_key=api_key
):
    print(partial, end="", flush=True)

Parameter Examples

Claude Models - Thinking Budget

Controls how much "thinking" the model does before responding:

python
import fastapi_poe as fp
import os

api_key = os.getenv("POE_API_KEY")

message = fp.ProtocolMessage(
    role="user",
    content="Explain quantum computing in detail",
    parameters={"thinking_budget": 12288}  # Higher = more thinking
)

for partial in fp.get_bot_response_sync(
    messages=[message],
    bot_name="Claude-Sonnet-4.5",
    api_key=api_key
):
    print(partial, end="", flush=True)

Thinking Budget Values:

  • Lower values (e.g., 1000): Faster responses, less deep thinking
  • Higher values (e.g., 12288): Slower responses, more thorough analysis

GPT Models - Reasoning Effort

Controls reasoning intensity for GPT models:

python
message = fp.ProtocolMessage(
    role="user",
    content="Solve this complex math problem step by step",
    parameters={"reasoning_effort": "high"}  # Options: "low", "medium", "high"
)

for partial in fp.get_bot_response_sync(
    messages=[message],
    bot_name="GPT-5",
    api_key=api_key
):
    print(partial, end="", flush=True)

Reasoning Effort Options:

  • "low": Faster, less intensive reasoning
  • "medium": Balanced
  • "high": Slower, more thorough reasoning

Image Generation - Aspect Ratio

For image generation bots like Imagen-4:

python
message = fp.ProtocolMessage(
    role="user",
    content="A cat wearing a hat",
    parameters={"aspect_ratio": "4:3"}  # Options: "1:1", "4:3", "16:9", "9:16", etc.
)

for partial in fp.get_bot_response_sync(
    messages=[message],
    bot_name="Imagen-4",
    api_key=api_key
):
    print(partial, end="", flush=True)

Common Aspect Ratios:

  • "1:1": Square
  • "4:3": Traditional
  • "16:9": Widescreen
  • "9:16": Portrait/vertical

Complete Examples

Claude with Thinking Budget

python
import fastapi_poe as fp
import os

api_key = os.getenv("POE_API_KEY")

message = fp.ProtocolMessage(
    role="user",
    content="Analyze the pros and cons of renewable energy",
    parameters={"thinking_budget": 8192}
)

print("Querying Claude with high thinking budget...")
for partial in fp.get_bot_response_sync(
    messages=[message],
    bot_name="Claude-Sonnet-4.5",
    api_key=api_key
):
    print(partial, end="", flush=True)

GPT with Reasoning Effort

python
import fastapi_poe as fp
import os

api_key = os.getenv("POE_API_KEY")

message = fp.ProtocolMessage(
    role="user",
    content="Prove the Pythagorean theorem",
    parameters={"reasoning_effort": "high"}
)

print("Querying GPT-5 with high reasoning effort...")
for partial in fp.get_bot_response_sync(
    messages=[message],
    bot_name="GPT-5",
    api_key=api_key
):
    print(partial, end="", flush=True)

Multiple Parameters

Some bots may support multiple parameters:

python
message = fp.ProtocolMessage(
    role="user",
    content="Generate an image",
    parameters={
        "aspect_ratio": "16:9",
        "quality": "high"  # If supported by bot
    }
)

Verification

Check that parameters are being applied:

  • Thinking budget: Response should be more detailed with higher values
  • Reasoning effort: Response should show more step-by-step reasoning
  • Aspect ratio: Generated images should match specified ratio

Troubleshooting

Problem: Parameters seem ignored
Solution:

  • Verify you're using parameters dict, not content string
  • Check bot supports the parameter
  • Verify parameter name spelling

Problem: Invalid parameter error
Solution:

  • Check parameter name is correct
  • Verify parameter value format
  • Consult bot-specific documentation

Problem: No difference with parameters
Solution:

  • Some bots may not support all parameters
  • Try different parameter values
  • Test with a bot that definitely supports the parameter

Parameter Reference

ParameterBot TypeValuesDescription
thinking_budgetClaudeInteger (e.g., 12288)Amount of thinking before response
reasoning_effortGPT"low", "medium", "high"Reasoning intensity level
aspect_ratioImage bots"1:1", "4:3", "16:9", etc.Image dimensions ratio

Best Practices

  1. Use appropriate values - Higher thinking budget = more points consumed
  2. Test parameters - Verify they work with your chosen bot
  3. Document parameters - Keep track of what works for your use case
  4. Monitor costs - Parameters may affect point consumption

See Also


Next: Workflows Overview

Poe API Documentation