Connect CrewAI
Route a CrewAI LLM through its native custom OpenAI-compatible endpoint configuration.
https://aelder.dev/v1LOCAL CONFIGURATION
Let my agent set this up
Copy this task to an agent already running on your computer. Enter your API key locally when asked.
Help me connect CrewAI to AELDER using this guide: https://aelder.dev/docs/crewai/
Service Base URL: https://aelder.dev/v1
First inspect my installed version, active profile and configuration. Explain any mismatch with the guide before changing anything.
Use the documented local configuration or CLI method. Do not automate the GUI, install software or change permissions without asking.
Preserve existing accounts, providers, models, defaults, permissions and unrelated settings. Propose the smallest change, show a redacted diff, and back up any files before editing.
Have me enter my API key locally using the tool's secret storage or an environment variable. Never ask me to paste a key into chat, print it, or include it in a command, diff, log or commit.
Use the exact model ID I choose from my account's model list. Do not invent model IDs or assume every model supports every API format or tool feature.
Validate syntax and configuration loading before making any generation request. If there is no dry-run, say so.
Explain any proposed paid test, the model and what it sends, and ask for approval before running it. Do not send project files or private conversation history as a test.
Finish with the settings changed, checks performed and steps to restore the backup.Current CrewAI releases have a native custom OpenAI-compatible route. custom_openai=True selects that adapter explicitly, so a model’s name does not accidentally select another vendor’s protocol. This guide uses Chat Completions at /v1/chat/completions.
Use an existing CrewAI Python environment. Check that your installed release supports custom_openai; older examples that depend on LiteLLM routing use a different configuration path.
1. Prepare local values
Set SERVICE_BASE_URL to the Base URL above, including /v1. Set SERVICE_MODEL_ID to the exact ID from the authenticated models endpoint. Make SERVICE_API_KEY available through your local secrets tooling, or read it in Bash or Zsh:
export SERVICE_BASE_URL="https://aelder.dev/v1"
export SERVICE_MODEL_ID="YOUR_MODEL_ID"
printf 'Service API key: '
IFS= read -r -s SERVICE_API_KEY
printf '\n'
export SERVICE_API_KEYKeep the literal key out of agent chats and tracked files. Launch the application from a process that inherits these values.
2. Build the LLM
import os
from crewai import LLM
llm = LLM(
model="openai/" + os.environ["SERVICE_MODEL_ID"],
custom_openai=True,
api="completions",
base_url=os.environ["SERVICE_BASE_URL"],
api_key=os.environ["SERVICE_API_KEY"],
)CrewAI removes the first openai/ routing prefix in this configuration. Everything after it is the exact service ID, including any additional slashes. Do not remove a prefix that is part of the service’s own ID. api="completions" explicitly selects Chat Completions. Do not append /chat/completions to base_url.
Pass llm=llm to the existing Agent that should use this connection. Update any separately configured manager, planning or function-calling LLM deliberately; setting one agent’s LLM does not change every model in a crew. Preserve unrelated settings and tools.
3. Verify before running a crew
Constructing llm checks the local configuration. This separate call sends a billable request:
print(llm.call("Reply with OK."))Confirm the model and usage in the service dashboard. A crew kickoff can run multiple agents, delegate work and retry, producing several requests. Start with the direct call before a complete workflow.
Change SERVICE_MODEL_ID and recreate llm to choose another model. Catalog visibility does not verify tool calling, structured output or reasoning support. CrewAI’s context and cost metadata may come from its own registry; it is not proof of this service’s limits or billing.
For 401 errors, check the inherited key. For unknown models, inspect the model ID after CrewAI’s routing prefix is removed. For rejected fields, confirm the installed adapter and the selected model’s capabilities before enabling optional parameters.
Sources: CrewAI’s LLM configuration and native provider routing. The native configuration was reviewed; a live service run has not been verified.
Need the key? Open your AELDER dashboard. For direct API calls, see the API reference.

