Loading Model APIs model
Model APIs
deepseek-ai/DeepSeek-V4-Flash-0731
Chat completions for server-side applications through a workspace API key.
No cache discount applies. Cached input is billed at the standard $0.14 per 1M input tokens.
Hosted inference requires the Core plan or higher.
Set RUNINFRA_GATEWAY_KEY to a workspace API key. Each example reads the key from the environment.
import os
import uuid
from openai import OpenAI
api_key = os.environ.get("RUNINFRA_GATEWAY_KEY")
if not api_key: raise RuntimeError("Set RUNINFRA_GATEWAY_KEY first.")
client = OpenAI(
api_key=api_key,
base_url="https://api.runinfra.ai/v1",
)
response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Hello"}],
max_tokens=512,
extra_headers={"X-Client-Request-Id": str(uuid.uuid4())},
)
print(response.choices[0].message.content)https://api.runinfra.ai/v1
Company