secrets dictionary containing API keys and other sensitive values your environment or sandbox needs at runtime:
__init__ method receives these via the secrets parameter:
How It Works
- The client passes secrets when creating a session
- OpenReward stores the real values and replaces them with opaque placeholders
- Your environment receives only the placeholders
- When an outbound request leaves your environment or sandbox, OpenReward injects the real value - but only if the destination host is allowed
Allowed Outbound Hosts
Each secret has a list of allowed hosts that it can be sent to. For common API keys, OpenReward provides sensible defaults:| Secret Name | Default Allowed Hosts |
|---|---|
OPENAI_API_KEY | api.openai.com |
ANTHROPIC_API_KEY | api.anthropic.com |
GEMINI_API_KEY | generativelanguage.googleapis.com |
GOOGLE_API_KEY | generativelanguage.googleapis.com |
TAVILY_API_KEY | api.tavily.com |
MISTRAL_API_KEY | api.mistral.ai |
COHERE_API_KEY | api.cohere.com |
GROQ_API_KEY | api.groq.com |
TOGETHER_API_KEY | api.together.xyz |
REPLICATE_API_TOKEN | api.replicate.com |
HUGGINGFACE_API_KEY | api-inference.huggingface.co, huggingface.co |
HF_TOKEN | huggingface.co, api-inference.huggingface.co |
HUGGING_FACE_HUB_TOKEN | huggingface.co, api-inference.huggingface.co |
PERPLEXITY_API_KEY | api.perplexity.ai |
FIREWORKS_API_KEY | api.fireworks.ai |
DEEPSEEK_API_KEY | api.deepseek.com |
KAGGLE_KEY | www.kaggle.com |
KAGGLE_USERNAME | www.kaggle.com |
KAGGLE_API_KEY | www.kaggle.com |
E2B_API_KEY | api.e2b.app |
MODAL_TOKEN_ID | api.modal.com |
MODAL_TOKEN_SECRET | api.modal.com |
DAYTONA_API_KEY | app.daytona.io |
(value, [hosts]) tuple instead of a plain string:
Secrets with default allowed hosts can be passed as plain strings. Secrets without defaults must use the
(value, [hosts]) format — otherwise the request will be rejected.
