Nyraxis/ docs
Integrations
Developer documentation

Fireworks AI

Put an explicit Nyraxis text gate around an OpenAI-compatible Fireworks AI call.

This is an integration recipe. The live OpenAI test does not certify a Fireworks AI account, model or compatibility edge case.

Install and configure

Complete the quickstart, configure a policy for docs-integration, and save nyraxis_gate.py beside example.py.

python -m pip install nyraxis-sdk==1.3.2 openai

Set NYRAXIS_API_KEY, NYRAXIS_BASE_URL, FIREWORKS_API_KEY and FIREWORKS_MODEL. Select a model available to your provider account.

import os
from openai import OpenAI
from nyraxis_gate import guarded_text_call

model = OpenAI(base_url="https://api.fireworks.ai/inference/v1", api_key=os.environ["FIREWORKS_API_KEY"])
def generate(prompt):
    result = model.chat.completions.create(
        model=os.environ["FIREWORKS_MODEL"],
        messages=[{"role": "user", "content": prompt}],
    )
    return result.choices[0].message.content or ""

print(guarded_text_call("Explain how to contact support.", generate))

The helper checks input before this call and buffered output before returning. Incomplete evaluations and blocked text raise errors. Run safe, blocked-input, blocked-output and unreachable-Nyraxis cases, and verify actual provider-call counts.

Review provider documentation for request compatibility. Text evaluation does not authorize tools or inspect multimodal content. Streaming requires its own release boundary; do not send tokens to a user and then expect a final check to retract them.

See SDK coverage, Python client and data handling.

On this page