Together AI
Put an explicit Nyraxis text gate around an OpenAI-compatible Together AI call.
This is an integration recipe. The live OpenAI test does not certify a Together 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 openaiSet NYRAXIS_API_KEY, NYRAXIS_BASE_URL, TOGETHER_API_KEY and TOGETHER_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.together.xyz/v1", api_key=os.environ["TOGETHER_API_KEY"])
def generate(prompt):
result = model.chat.completions.create(
model=os.environ["TOGETHER_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.