Skip to main content
GET
/
api
/
models
import requests

url = "https://api.keywordsai.co/api/models/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}
params = {"sort_by": "model_name"}

response = requests.get(url, headers=headers, params=params)
print(response.json())
[
  {
    "id": "my-custom-gpt-4",
    "model_name": "my-custom-gpt-4",
    "display_name": "My Custom GPT-4",
    "base_model_name": "gpt-4",
    "affiliation_category": "custom",
    "is_called_by_custom_name": false,
    "input_cost": 0.03,
    "output_cost": 0.06,
    "cache_hit_input_cost": 0.0,
    "cache_creation_input_cost": 0.0,
    "max_context_window": 8192,
    "streaming_support": 1,
    "function_call": 1,
    "image_support": 0,
    "source": "db",
    "provider": {
      "id": "my-custom-provider",
      "provider_id": "my-custom-provider",
      "provider_name": "My Custom Provider",
      "organization_id": 123
    }
  },
  {
    "id": "openai/gpt-4",
    "model_name": "openai/gpt-4",
    "display_name": "GPT-4",
    "affiliation_category": "keywordsai",
    "input_cost": 0.03,
    "output_cost": 0.06,
    "max_context_window": 8192,
    "streaming_support": 1,
    "function_call": 1,
    "image_support": 0,
    "source": "hardcoded",
    "provider": null
  }
]

Documentation Index

Fetch the complete documentation index at: https://docs.keywordsai.co/llms.txt

Use this file to discover all available pages before exploring further.

Retrieve all models accessible to your organization, including both global models (shared across all organizations) and your custom models.

Query parameters

sort_by
string
default:"model_name"
Field to sort by.
?sort_by=model_name
all
boolean
default:false
If true, returns all models without pagination.

Response

Returns an array of model objects with their configurations and associated providers. Model types:
  • Global models (affiliation_category: "keywordsai"): Shared across all organizations
  • Custom models (affiliation_category: "custom"): Organization-specific models
[
  {
    "id": "my-custom-gpt-4",
    "model_name": "my-custom-gpt-4",
    "display_name": "My Custom GPT-4",
    "base_model_name": "gpt-4",
    "affiliation_category": "custom",
    "is_called_by_custom_name": false,
    "input_cost": 0.03,
    "output_cost": 0.06,
    "cache_hit_input_cost": 0.0,
    "cache_creation_input_cost": 0.0,
    "max_context_window": 8192,
    "streaming_support": 1,
    "function_call": 1,
    "image_support": 0,
    "source": "db",
    "provider": {
      "id": "my-custom-provider",
      "provider_id": "my-custom-provider",
      "provider_name": "My Custom Provider",
      "organization_id": 123
    }
  },
  {
    "id": "openai/gpt-4",
    "model_name": "openai/gpt-4",
    "display_name": "GPT-4",
    "affiliation_category": "keywordsai",
    "input_cost": 0.03,
    "output_cost": 0.06,
    "max_context_window": 8192,
    "streaming_support": 1,
    "function_call": 1,
    "image_support": 0,
    "source": "hardcoded",
    "provider": null
  }
]
import requests

url = "https://api.keywordsai.co/api/models/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}
params = {"sort_by": "model_name"}

response = requests.get(url, headers=headers, params=params)
print(response.json())