AI/ML API integrations
AI/ML API provides a single API for accessing 300+ hosted foundation models (DeepSeek, Gemini, GPT, and more) with enterprise-grade uptime and throughput.
Installation and setup
-
Install the AI/ML API integration package.
pip install langchain-aimlapi -
Create an account at aimlapi.com and generate an API key.
-
Authenticate by setting the
AIMLAPI_API_KEYenvironment variable.
import os
os.environ["AIMLAPI_API_KEY"] = "aimlapi_..."Chat models
See a usage example.
from langchain_aimlapi import ChatAimlapiLLMs
See a usage example.
from langchain_aimlapi import AimlapiLLMEmbedding models
See a usage example.
from langchain_aimlapi import AimlapiEmbeddings