This tutorial shows how to create a minimal VeADK Java agent and run one conversation through Runner.
Prerequisites
- You have completed Installation and added
com.volcengine.veadk:veadk-java to your project.
- You have an API Key for Volcengine Ark or another OpenAI-compatible model service, and permission to call the selected model.
- The following commands use Bash or zsh. Run configuration and execution commands in the same terminal.
Export the model API Key in the current terminal:
If no provider is configured explicitly, VeADK Java uses the OpenAI-compatible path by default. The default base URL is Ark’s OpenAI-compatible endpoint. To use OpenAI official, LiteLLM Proxy, or an internal compatible gateway, override it with modelApiBase(...) or modelBaseUrl(...).
Write the Minimal Agent
Create Main.java in your Maven project:
Agent.builder() is the main VeADK Java entry point. new Runner(agent).run(...) creates the default user and session, performs one blocking call, and returns the final text.
Use the Ark-Specific Adapter
Use modelProvider("ark") only when you want the Ark-specific ArkLlm adapter:
For OpenAI official, LiteLLM Proxy, or an internal OpenAI-compatible gateway, point the base URL to that endpoint:
Run Repository Examples
In the veadk-java source repository root, run the basic Agent example:
This example creates an Ark-backed Agent, registers a Java function tool, and calls Runner.run(...).
Start the ADK Web example:
The default access URL is http://localhost:8000.
Continue a Session
To continue context across turns, reuse the same userId and sessionId:
By default, Runner.run(String) uses the default user and auto-creates a session. Passing userId and sessionId explicitly lets you control session ownership and reuse.
Troubleshooting the First Run
Last modified on October 20, 2026