Skip to content

Get started with TIR GenAI API

View as Markdown

Send a prompt to a model in the Playground, then call the same model from your own code with the OpenAI SDK. All you need is a TIR project.

  1. In TIR, open your project. In the side menu’s PRODUCTS list, select GenAI API. The Models page opens, listing every model you can use.
  2. Select an available model, such as DeepSeek V3, which the examples use. The model’s own page opens. A model that is out of inventory shows Request instead. Which models are available changes over time; the FAQ explains what that means for code you have written.
  3. Type a prompt in the chat box and send it. The model’s reply appears in the chat.

Every GenAI API request needs a token to authenticate it.

  1. In the side menu, select Personal Access Tokens. The Manage Tokens page opens.
  2. Select Create Token. Keep the generated name or type your own, then confirm.
  3. Copy the Auth Token shown in the dialog and store it somewhere safe. You can copy it again later from the Personal Access Tokens list.

DeepSeek V3 is a text-generation model, so it works with the OpenAI SDK pointed at its TIR endpoint.

  1. Install the SDK:

    pip install -U openai
  2. On the model’s page, select Get Code, then the Python tab. The sample already has the model’s endpoint for your project.

  3. Copy the sample into a file, and set its API key value to the Auth Token you copied. Use the Auth Token here rather than E2E’s separate API Key.

  4. Run the script. The model’s reply prints to your console.

If a request fails, Troubleshooting TIR GenAI API explains what to do.