# DeepInfra

> Run AI models and inspect model, deployment and inference batch information.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/deepinfra

## Actions

### Decode token IDs

Turn token IDs back into readable text for a selected model.

**Inputs**

- Model (`model`, text, required): Model.
- Tokens (`tokens`, list, required): Tokens.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "prompt": "example"
  }
}
```

### Generate a chat response

Generate a response using a DeepInfra chat model. Uses inference credits.

**Inputs**

- Model (`model`, text, required): Model.
- Messages (`messages`, list, required): Messages.
- Temperature (`temperature`, number): Temperature. From 0 to 2.
- Max tokens (`max_tokens`, number): Max tokens. At least 1.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "choices": [],
    "id": "example",
    "model": "example",
    "usage": {
      "completion_tokens": 1,
      "prompt_tokens": 1,
      "total_tokens": 1
    }
  }
}
```

### Generate an image

Create an image using a DeepInfra image model. Uses inference credits.

**Inputs**

- Model (`model`, text, required): Model.
- N (`n`, number): N. From 1.0 to 4.0.
- Response format (`response_format`, text): Response format. One of: `b64_json` (B64 json), `url`.
- Size (`size`, text): Size.
- Prompt (`prompt`, text, required): Prompt.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "created": 1,
    "data": []
  }
}
```

### Generate text embeddings

Turn text into vectors using a DeepInfra embedding model. Uses inference credits.

**Inputs**

- Model (`model`, text, required): Model.
- Input (`input`, text, required): Input.
- Encoding format (`encoding_format`, text): Encoding format. One of: `float`, `base64`.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "data": [],
    "model": "example"
  }
}
```

### Get a voice

Get a voice from your DeepInfra connection.

**Inputs**

- Voice (`voice_id`, text, required): Voice id.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "created_at": 1,
    "description": "example",
    "name": "example",
    "updated_at": 1,
    "user_id": "example",
    "voice_id": "example"
  }
}
```

### Get account details

Get account details from your DeepInfra connection.

**Inputs**: None.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "account_setup": false,
    "can_access_agents": false,
    "can_access_sandboxes": false,
    "checklist": {
      "billing_address": false,
      "billing_address_info": {
        "city": "example",
        "country": "example",
        "line1": "example",
        "line2": "example",
        "name": "example",
        "postal_code": "example",
        "state": "example"
      },
      "billing_type": "example",
      "email": false,
      "last_checked": 1,
      "limit": 1.0,
      "overdue_invoices": 1.0,
      "payment_collection": "example",
      "payment_method": false,
      "payment_method_info": {
        "card": {
          "brand": "example",
          "last4": "example",
          "wallet": "example"
        },
        "cashapp": {
          "cashtag": "example"
        },
        "type": "example",
        "us_bank_account": {
          "bank_name": "example",
          "last4": "example"
        }
      },
      "payment_method_required": false,
      "recent": 1.0,
      "scoped_credits": [],
      "stripe_balance": 1.0,
      "suspend_reason": "balance",
      "suspended": false,
      "topup": false,
      "topup_amount": 1,
      "topup_failed": false,
      "topup_threshold": 1
    },
    "company": "example",
    "country": "example",
    "display_name": "example",
    "email": "example",
    "email_verified": false,
    "first_name": "example",
    "google_linked": false,
    "is_admin": false,
    "is_business_account": false,
    "is_team_account": false,
    "is_team_owner": false,
    "is_team_upgrade_enabled": false,
    "last_name": "example",
    "mfa_available": false,
    "mfa_enabled": false,
    "name": "example",
    "picture": "example",
    "provider": "example",
    "require_email_verified": false,
    "root_uid": "example",
    "show_signup_form": false,
    "team_display_name": "example",
    "team_role": "example",
    "title": "example",
    "uid": "example",
    "vercel_connection": {
      "installation_id": "example",
      "team_id": "example",
      "user_id": "example"
    },
    "website": "example"
  }
}
```

### Get account GPU pool

Get account GPU pool from your DeepInfra connection.

**Inputs**: None.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "last_rejection": {
      "created_at": 1,
      "id": "example",
      "reason": "example",
      "requested_max": {},
      "resolution_reason": "example",
      "resolved_at": 1
    },
    "max_limits": {},
    "min_limits": {},
    "pending_request": {
      "created_at": 1,
      "id": "example",
      "reason": "example",
      "requested_max": {}
    }
  }
}
```

### Get account rate limits

Get account rate limits from your DeepInfra connection.

**Inputs**: None.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {}
}
```

### Get an inference batch

Get an inference batch from your DeepInfra connection.

**Inputs**

- Batch id (`batch_id`, text, required): Batch id.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "cancelled_at": 1,
    "cancelling_at": 1,
    "completed_at": 1,
    "completion_window": "example",
    "created_at": 1,
    "endpoint": "example",
    "error_file_id": "example",
    "errors": {
      "data": [],
      "object": "example"
    },
    "expired_at": 1,
    "expires_at": 1,
    "failed_at": 1,
    "finalizing_at": 1,
    "id": "example",
    "in_progress_at": 1,
    "input_file_id": "example",
    "metadata": {},
    "model": "example",
    "object": "example",
    "output_file_id": "example",
    "request_counts": {
      "completed": 1,
      "failed": 1,
      "total": 1
    },
    "status": "example",
    "usage": {
      "input_tokens": 1,
      "input_tokens_details": {
        "cached_tokens": 1,
        "image_tokens": 1
      },
      "output_tokens": 1,
      "output_tokens_details": {
        "reasoning_tokens": 1
      },
      "total_tokens": 1
    }
  }
}
```

### Get deployment details

Get deployment details from your DeepInfra connection.

**Inputs**

- Deploy (`deploy_id`, text, required): Deploy id.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "config": {
      "gpu": "L4-24GB",
      "max_batch_size": 1,
      "num_gpus": 1,
      "weights": {
        "repo": "example",
        "revision": "example",
        "token": "example"
      }
    },
    "created_at": "example",
    "deploy_id": "example",
    "extra_args": [],
    "fail_reason": "example",
    "instances": {
      "pending": 1,
      "running": 1,
      "warming": 1
    },
    "model_name": "example",
    "rollout": {
      "booting": 1,
      "outdated": 1,
      "up_to_date": 1
    },
    "settings": {
      "max_instances": 1,
      "min_instances": 1
    },
    "standard_args": {
      "enable_prefix_caching": false,
      "gpu_memory_fraction": 1.0,
      "kv_cache_dtype": "auto",
      "max_concurrent_requests": 1,
      "max_context_size": 1,
      "max_images_per_prompt": 1,
      "max_prefill_tokens": 1,
      "quantization": "fp8"
    },
    "status": "example",
    "task": "example",
    "type": "legacy",
    "update_error": "example",
    "updated_at": "example",
    "version": "example"
  }
}
```

### Get deployment statistics

Get deployment statistics from your DeepInfra connection.

**Inputs**

- Deploy (`deploy_id`, text, required): Deploy id.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "avg95_time": 1.0,
    "avg_time": 1.0,
    "errors": 1,
    "input_tokens": 1,
    "output_tokens": 1,
    "requests": 1,
    "total_amount": 1,
    "total_time": 1,
    "total_tokens": 1
  }
}
```

### List available voices

List available voices from your DeepInfra connection.

**Inputs**: None.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "voices": []
  }
}
```

### List deployments

List deployments from your DeepInfra connection.

**Inputs**

- Status (`status`, text): Status.

**Outputs**: Response.

- `data` (list): Data.

**Example output**

```json
{
  "data": []
}
```

### List featured models

List featured models from your DeepInfra connection.

**Inputs**: None.

**Outputs**: Response.

- `data` (list): Data.

**Example output**

```json
{
  "data": []
}
```

### List GPU pool types

List GPU pool types from your DeepInfra connection.

**Inputs**: None.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "gpu_types": []
  }
}
```

### List hardware

List hardware from your DeepInfra connection.

**Inputs**: None.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "hardware": []
  }
}
```

### List inference batches

List inference batches from your DeepInfra connection.

**Inputs**

- After (`after`, text): After.
- Limit (`limit`, number): Limit.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "data": [],
    "has_more": false,
    "last_id": "example"
  }
}
```

### List inference models

List inference models from your DeepInfra connection.

**Inputs**

- Sort by (`sort_by`, text): Sort by.
- Filter (`filter`, text): Filter.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "data": [],
    "object": "example"
  }
}
```

### List public models

List public models from your DeepInfra connection.

**Inputs**: None.

**Outputs**: Response.

- `data` (list): Data.

**Example output**

```json
{
  "data": []
}
```

### Tokenize text

Convert text to token IDs for a selected DeepInfra model.

**Inputs**

- Model (`model`, text, required): Model.
- Prompt (`prompt`, text, required): Prompt.
- Return token strs (`return_token_strs`, true/false): Return token strs.

**Outputs**: Response.

- `data` (object): Data.

**Example output**

```json
{
  "data": {
    "count": 1,
    "max_model_len": 1,
    "token_strs": [],
    "tokens": []
  }
}
```
