Skip to main content

Models API

The Models API allows you to list and retrieve information about the models available through Conduit.

List Models

Lists the models available for use through Conduit.

Endpoint

GET /v1/models

Headers

HeaderValueRequiredDescription
AuthorizationBearer condt_your_virtual_keyYesYour Conduit virtual key

Query Parameters

ParameterTypeRequiredDescription
capabilitystringNoFilter by model capability (e.g., 'chat', 'embeddings')
providerstringNoFilter by provider (e.g., 'openai', 'anthropic')

Example

curl http://localhost:5000/v1/models \
-H "Authorization: Bearer condt_your_virtual_key"

Response Format

{
"object": "list",
"data": [
{
"id": "my-gpt4",
"object": "model",
"created": 1677610602,
"owned_by": "conduit",
"provider": "anthropic",
"provider_model": "claude-3-opus-20240229",
"capabilities": ["chat", "function_calling", "vision"]
},
{
"id": "my-embedding-model",
"object": "model",
"created": 1677649963,
"owned_by": "conduit",
"provider": "openai",
"provider_model": "text-embedding-ada-002",
"capabilities": ["embeddings"]
}
]
}

Retrieve Model

Retrieves a specific model's information.

Endpoint

GET /v1/models/{model_id}

Example

curl http://localhost:5000/v1/models/my-gpt4 \
-H "Authorization: Bearer condt_your_virtual_key"

Response Format

{
"id": "my-gpt4",
"object": "model",
"created": 1677610602,
"owned_by": "conduit",
"provider": "anthropic",
"provider_model": "claude-3-opus-20240229",
"capabilities": ["chat", "function_calling", "vision"],
"context_length": 200000,
"status": "available"
}

Conduit Extensions

Conduit includes additional model-related endpoints:

List Provider Models

Lists all available models from a specific provider.

GET /v1/provider-models/{provider}
curl http://localhost:5000/v1/provider-models/openai \
-H "Authorization: Bearer condt_your_virtual_key"

Model Capabilities

The capabilities field in model responses indicates what features a model supports:

CapabilityDescription
chatSupports chat completions
completionsSupports text completions
embeddingsSupports text embeddings
function_callingSupports function calling / tools
visionSupports image inputs
streamingSupports streaming responses
json_modeSupports JSON mode output

Model Status

The status field can have these values:

StatusDescription
availableModel is available for use
unavailableModel is temporarily unavailable
deprecatedModel is deprecated and may be removed
limitedModel has usage limitations

Best Practices

Virtual Model Abstraction

Conduit virtual models abstract away specific provider models. This means:

  • Your applications should use the virtual model names (my-gpt4)
  • The underlying provider model can be changed without affecting your code
  • Different provider models can be grouped under the same virtual model name

Model Discovery Workflow

  1. List all available models with the Models API
  2. Filter models by capability for your use case
  3. Test models to find the best balance of performance vs. cost
  4. Configure model mappings in Conduit for flexibility

Error Handling

HTTP CodeError TypeDescription
401authentication_errorInvalid or missing API key
403permission_errorThe API key doesn't have permission
404not_found_errorThe requested model was not found
429rate_limit_errorRate limit exceeded
500server_errorServer error

Next Steps