For the following example to work, save your API key to the NEBIUS_API_KEY environment variable. Here is a sample JSON request body that includes all supported fields:
from openai import OpenAI

client = OpenAI(
    base_url="https://api.studio.nebius.com/v1/",
    api_key=os.environ.get("NEBIUS_API_KEY"),
)

for chunk in client.completions.create(
        model="meta-llama/Meta-Llama-3.1-70B-Instruct",
        prompt="Say my name",
        max_tokens=7,
        temperature=0,
        stream=True
):
    print(chunk.choices[0].text)
For detailed field descriptions, see the API reference.