Skip to main content
Configure a model, create an agent, and execute a conversation with Runner to see the model’s answer in your terminal

Prerequisites

  • Complete the installation and activate the Python environment containing VeADK
  • Obtain a Volcengine Ark or BytePlus ModelArk API key with permission to call your chosen model
  • The environment variable examples use Bash or zsh. Configure and run the example in the same terminal

Configure a model

Select the platform hosting your model. Use an API key issued by that platform and replace the model name with one available to your account
Prepare an API key and an available model in the Ark console, then set:
MODEL_AGENT_PROVIDER=openai selects the OpenAI-compatible protocol. Requests go to the platform address in MODEL_AGENT_API_BASE. This example sets the model, address, and credentials explicitly so it does not depend on version-specific defaults
Running the example sends the prompt to the selected model service and may incur model charges. Use test content and keep real API keys out of example files and version control

Create and run an agent

Create main.py in your project directory:
main.py
Agent defines the model, instructions, and tools. Runner executes the conversation. Here, Agent() uses the model configuration set earlier, and runner.run(...) returns the response text Run the script from the directory containing main.py:
The terminal displays execution logs and the model’s answer. A nonempty answer indicates that the call completed. The model generates the answer, so its wording can vary

Optional: Use a configuration file

To reuse nonsensitive model settings, create config.yaml beside main.py. This example configures Volcengine Ark; continue supplying the API key through the environment:
config.yaml
VeADK searches for config.yaml from the current working directory upward. Existing environment variables take precedence over matching file settings. Editing the file does not override model settings exported earlier. See Models for additional options

Troubleshoot the first run

Last modified on September 19, 2026