The Models API Route feature allows you to easily fetch and filter AI API Models available through our API, enabling precise selections based on model types, subtypes, providers, and more. This guide provides details on how to use the Models Route feature effectively for your AI applications.
You can retrieve a list of available models or filter them based on specific criteria like type, subtype, and provider. Below is the API endpoint for fetching models:
GET https://apipie.ai/v1/models
Here are the parameters you can use to filter the model results:
llm, vision, embedding, image, voice, moderation, coding, free).llmchat, fill-mask, question-answering, tts, stt, multimodal).chatopenrouter).openrouterprovider=openrouter&subtype=chat1 for enabled, 0 for disabled).enabled=1&subtype=chatvoicesrestrictionsBelow are some example requests using curl:
curl "https://apipie.ai/v1/models?type=llm"
curl "https://apipie.ai/v1/models?subtype=multimodal"
curl "https://apipie.ai/v1/models?type=embedding"
curl "https://apipie.ai/v1/models?subtypetype=code"
curl "https://apipie.ai/v1/models?type=llm&provider=openai"
curl "https://apipie.ai/v1/models?type=llm&model=gpt-3.5-turbo-0125"
You can filter all available pools by setting the subtype=pool parameter in your API call. This lists all models grouped into pools.
Example:
curl "https://apipie.ai/v1/models?subtype=pool"
The subtype=chatx filter allows you to list all models that support streaming and memory services, ensuring a high-quality chat experience. These models are designed for real-time applications that require context retention across queries.
Example:
curl "https://apipie.ai/v1/models?subtype=chatx"
We will provde a list of all voices available from all our voice providers along with some voice details if available.
curl -X GET 'https://apipie.ai/v1/models?voices'
{
"object": "list",
"data": [
{
"provider": "elevenlabs",
"model": "eleven_multilingual_v2",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"name": "Rachel",
"description": "description: calm, age: young, gender: female, accent: american, use case: narration"
},
{
"provider": "elevenlabs",
"model": "eleven_multilingual_v1",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"name": "Rachel",
"description": "description: calm, age: young, gender: female, accent: american, use case: narration"
},
{
"provider": "elevenlabs",
"model": "eleven_monolingual_v1"...
We use this to list all the countries you are allowed to serve this AI to, serving any countries prohibited by any of these restricitons could cause significant consequences from APIpie to the underlyign aggregator and or the model provider themselves banning you and potentially with legal implications, you must not be a relay to work around these restrictions. If there are any providers not listed here, they are generally opensource and widely available without restriction.
curl -X GET 'https://apipie.ai/v1/models?restrictions'
{
"object": "list",
"data": [
{
"restrict_id": 2,
"name": "openai",
"countries": "{\"countries\":[{\"name\":\"Albania\",\"alpha-2\":\"AL\"},{\"name\":\"Algeria\",\"alpha-2\":\"DZ\"},{\"name\":\"Afghanistan\",\"alpha-2\":\"AF\"},{\"name\":\"Andorra\",\"alpha-2\":\"AD\"},{\"name\":\"Angola\",\"alpha-2\":\"AO\"},{\"name\":\"Antigua and Barbuda\",\"alpha-2\":\"AG\"},{\"name\":\"Argentina\",\"alpha-2\":\"AR\"},{\"name\":\"Armenia\",\"alpha-2\":\"AM\"},{\"name\":\"Australia\",...
...
Here’s a summary of the fields in each model record, if available:
enabled: Whether the model is currently available (1 = enabled, 0 = disabled).type: The type of model (e.g., llm, vision, embedding).subtype: The subtype of the model (e.g., chat, tts).provider: The provider of the model (e.g., openrouter).route/model: The API route for the specific model.description: A description of the model's features and capabilities.max_tokens: The maximum number of tokens for the model.max_response_tokens: The maximum number of tokens in the model's response.req_price: The cost of a token for the model's input. (Some providers dont tell us the price until after the query so we dont track them here)res_price: The cost of a token for the model's output.price_type: The type of pricing (e.g., per token, per request).price_unit: The unit of pricing (e.g., USD).latency: The latency at various prompt sizes, 2000 char/ 4000 char/ 8000 char/ 16000 char / 32000 char+ / Total average latency per query across all prompt sizesavg_cost: The average cost of using the model for a request and response (can flcutuate based on usage for models that price input differently than output).query_count: The number of queries made to the model.available: Indicates whether the model is available for use.img: The cost per image when using vision models and uploading imagesimg_json: The cost per image when generating images, various sizes and qualities are listed in json formattype, subtype, and provider filters together to narrow down the exact models you need for specific tasks. For example, filtering by subtype=chat and provider=openrouter ensures you only receive chat-based models from OpenRouter.subtype=pool filter is ideal for querying models grouped into performance or use-case pools, while subtype=chatx ensures you're using models optimized for real-time chat applications with streaming and memory capabilities.voices or restrictions as query parameters to get more detailed options on voice models or country-specific availability.type=llm and provider=openai to get a more refined list of models matching both criteria.subtype=chatx filter do?chatx subtype lists models that support streaming and memory services, providing a better experience for real-time chat applications.voices query parameter to fetch all available TTS voices. This will list models that support text-to-speech functionalities.With this guide, you now have a clear understanding of how to use the Models Route feature to fetch and filter the AI models API effectively. Whether you need to query specific types, providers, or subtypes, our API offers robust capabilities to integrate the right models for your AI-powered projects.
Note: Always review the cost implications based on the filters applied, as certain models may incur higher API usage fees due to their enhanced capabilities.
Features: Key Tools & Features for Developers
APIpie's feature guide, model routing, completions, integrity, pooling, and RAG tuning. Learn about our platform capabilities and integration options.
Chat Completions Guide: Multi-Provider Integrations
Learn how to integrate conversational AI from multiple providers using APIpie's Chat Completions API. Features, examples, and best practices.