Agent Setup
This page explains how to configure Agent Mode with your preferred AI provider.
Accessing Agent Setup
- Open the Advanced Portal Designer menu page (search for it in Tell Me) and click Setup
- Scroll to the agent-related fields in the Setup card (
Use Coding Agent,Agent AI Provider,Provider Endpoint,Provider Key,Provider Model) - Fill in the provider settings
Configuration Fields
| Field | Description |
|---|---|
| Use Coding Agent | Enable/disable Agent Mode |
| Agent AI Provider | Select the AI provider |
| Provider Endpoint | API endpoint URL |
| Provider Key | API key for authentication |
| Provider Model | Specific model to use (optional) |
Provider Configuration
Azure OpenAI
Azure OpenAI provides enterprise-grade AI through Microsoft Azure.
Prerequisites:
- Azure subscription
- Azure OpenAI resource deployed
- Model deployment (GPT-4 or later recommended)
Configuration:
| Field | Value |
|---|---|
| Agent AI Provider | Azure Open AI |
| Provider Endpoint | https://{resource-name}.openai.azure.com/openai/deployments/{deployment-name}/chat/completions?api-version=2024-02-15-preview |
| Provider Key | Your Azure OpenAI API key |
| Provider Model | (leave blank - specified in endpoint) |
Finding Your Settings:
- Go to Azure Portal
- Open your Azure OpenAI resource
- Navigate to Keys and Endpoint
- Copy Key 1 or Key 2
- Navigate to Deployments
- Note your deployment name for the endpoint URL
Example Endpoint:
https://mycompany-openai.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-02-15-preview
ChatGPT OpenAI
Direct access to OpenAI's ChatGPT API.
Prerequisites:
- OpenAI account
- API key from platform.openai.com
Configuration:
| Field | Value |
|---|---|
| Agent AI Provider | ChatGPT Open AI |
| Provider Endpoint | https://api.openai.com/v1/chat/completions |
| Provider Key | Your OpenAI API key (sk-...) |
| Provider Model | A current OpenAI chat-completion model ID |
Getting Your API Key:
- Go to platform.openai.com
- Sign in or create account
- Navigate to API Keys
- Click Create new secret key
- Copy the key (only shown once!)
OpenAI publishes the current list of available model IDs at platform.openai.com/docs/models. Pick a current model from that list rather than copying a specific ID from here.
Anthropic (Claude)
Anthropic's Claude models, known for strong reasoning and large context.
Prerequisites:
- Anthropic account
- API key from console.anthropic.com
Configuration:
| Field | Value |
|---|---|
| Agent AI Provider | Anthropic (Claude) |
| Provider Endpoint | https://api.anthropic.com/v1/messages |
| Provider Key | Your Anthropic API key |
| Provider Model | A current Anthropic model identifier |
Getting Your API Key:
- Go to console.anthropic.com
- Sign in or create account
- Navigate to API Keys
- Create a new key
- Copy the key
Anthropic publishes the current list of available model IDs at docs.anthropic.com/en/docs/about-claude/models. Use that list to pick a current model ID rather than relying on a specific version string here, which will go stale as Anthropic ships new releases.
LM Studio
Run AI models locally using LM Studio for offline or privacy-focused scenarios.
Prerequisites:
- LM Studio installed
- Model downloaded in LM Studio
- Local server running
Configuration:
| Field | Value |
|---|---|
| Agent AI Provider | LM Studio |
| Provider Endpoint | http://localhost:1234/v1/chat/completions |
| Provider Key | (leave blank or use lm-studio) |
| Provider Model | Model name from LM Studio |
Setting Up LM Studio:
- Download LM Studio from lmstudio.ai
- Install and open LM Studio
- Download a model (recommended: Llama 3, Mistral, or similar)
- Start the local server in LM Studio
- Note the server URL (default:
http://localhost:1234)
Recommended Models for Portal Development:
- Llama 3 70B or larger
- Mistral Large
- DeepSeek Coder
Verifying Configuration
Test the Connection
- Open Agent Development page
- The agent control should initialize
- Send a simple message like "Hello"
- Verify you receive a response
Check Available Tools
- On Agent Development page
- Click Tools Available action
- Review the list of available tools
- All APD tools should be listed
HttpClient Requirements
Agent Mode requires HTTP calls to external AI providers.
Important: Ensure Allow HttpClient Requests is enabled:
- Go to Extension Management
- Find Advanced Portal Designer
- Click Configure
- Enable Allow HttpClient Requests
If this is disabled, you'll see an error:
"Allow HttpClient Requests" is turned off for this extension
Troubleshooting
"Missing API key" Error
- Verify Provider Key is entered
- Check for extra spaces
- Ensure key is valid and not expired
Connection Timeout
- Check endpoint URL format
- Verify network connectivity
- Check firewall settings
Rate Limiting (429 Error)
- Wait a few moments and retry
- Consider upgrading API plan
- Reduce request frequency
Invalid Endpoint
- Verify URL format matches provider requirements
- Check for typos
- Include required query parameters (for Azure)
Cost Considerations
AI providers charge based on token usage:
| Provider | Pricing Model |
|---|---|
| Azure OpenAI | Per 1K tokens (varies by model) |
| OpenAI | Per 1K tokens (varies by model) |
| Anthropic | Per 1K tokens (varies by model) |
| LM Studio | Free (local compute) |
Tips for Cost Management:
- Use smaller models for simple tasks
- Review token usage in provider dashboard
- Set usage limits in provider settings
Security Best Practices
API Key Security
- Never share API keys
- Use separate keys for dev/prod
- Rotate keys periodically
- Monitor usage for anomalies
Data Considerations
- AI providers may process portal structure data
- No customer data is sent to AI
- Review provider privacy policies