The Models API allows you to list and retrieve information about available language models in the Prime Intellect Inference service.

Base URL

https://api.pinference.ai/api/v1

Authentication

All requests require a Bearer token in the Authorization header:
Authorization: Bearer your_api_key

List Models

Returns a list of all available models that you can use for inference requests.

Request

curl -X GET https://api.pinference.ai/api/v1/models \
  -H "Authorization: Bearer $API_KEY"

Response

{
  "object": "list",
  "data": [
    {
      "id": "meta-llama/llama-3.1-70b-instruct",
      "object": "model",
      "owned_by": "meta",
      "created": 1693721698
    },
    {
      "id": "anthropic/claude-3-5-sonnet-20241022",
      "object": "model",
      "owned_by": "anthropic",
      "created": 1693721698
    }
  ]
}

Get Model Details

Retrieve detailed information about a specific model.

Request

curl -X GET https://api.pinference.ai/api/v1/models/meta-llama/llama-3.1-70b-instruct \
  -H "Authorization: Bearer $API_KEY"

Response

{
  "id": "meta-llama/llama-3.1-70b-instruct",
  "object": "model",
  "owned_by": "meta",
  "created": 1693721698
}

Error Responses

Model Not Found (404)

{
  "error": {
    "message": "The model 'invalid-model' does not exist",
    "type": "invalid_request_error",
    "code": "model_not_found"
  }
}

Authentication Error (401)

{
  "error": {
    "message": "Invalid API key",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}