Zum Hauptinhalt springen

Get all ai hosting plans and usages of a project

GET/v2/projects/{projectId}/ai-hostings
API-Version
v2
Request-Methode
GET
Operation-ID
ai-hosting-project-get-plans

Request​

  • projectIdstringrequired

Responses​

Response-Header
  • X-Pagination-Limitinteger

    The limit used to select the resources for the response

  • X-Pagination-Skipinteger

    The number of skipped items

  • X-Pagination-Pagenumber

    The calculate page of the list response. Refer to parameters to learn more.

  • X-Pagination-TotalCountinteger

    The total amount of items available in the remote ressource. Use this value in combination with the limit to calculate the available pages.

Format
application/json
Beschreibung

The list of plans with the project's current usage.

  • modelTermsApprovalRequiredbooleanrequired
  • plansArray von objectrequired
    • Array[
      • *object
        • descriptionstring
        • keysobjectrequired
          • availableinteger (≥ -1)required
          • planLimitinteger (≥ -1)required
          • usedinteger (≥ 0)required
        • modelTermsApprovalRequiredbooleanrequired
        • nextTokenResetstring (date-time)
        • planIdstringrequired
        • projectIdstringrequired
        • suspendedboolean
      ]
Content-Type: application/json

{
"modelTermsApprovalRequired": true,
"plans": [
{
"description": "string",
"keys": {
"available": 123,
"planLimit": 123,
"used": 123
},
"modelTermsApprovalRequired": true,
"nextTokenReset": "1985-10-26T01:21:00.000Z",
"planId": "string",
"projectId": "string",
"suspended": true
}
]
}
{
"properties": {
"modelTermsApprovalRequired": {
"default": false,
"type": "boolean"
},
"plans": {
"items": {
"properties": {
"description": {
"type": "string"
},
"keys": {
"properties": {
"available": {
"minimum": -1,
"type": "integer"
},
"planLimit": {
"minimum": -1,
"type": "integer"
},
"used": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"used",
"available",
"planLimit"
],
"type": "object"
},
"modelTermsApprovalRequired": {
"type": "boolean"
},
"nextTokenReset": {
"format": "date-time",
"type": "string"
},
"planId": {
"type": "string"
},
"projectId": {
"type": "string"
},
"suspended": {
"default": false,
"type": "boolean"
}
},
"required": [
"keys",
"projectId",
"planId",
"modelTermsApprovalRequired"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"plans",
"modelTermsApprovalRequired"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/projects/string/ai-hostings?limit=50&page=1
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.aiHosting.aiHostingProjectGetPlans({
"projectId": "string",
"queryParameters": {
"limit": 50,
"page": 1
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\AIHosting\AiHostingProjectGetPlans\AiHostingProjectGetPlansRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new AiHostingProjectGetPlansRequest(
projectId: "string"
))
->withLimit(50)
->withPage(1);
$response = $client->aiHosting()->aiHostingProjectGetPlans($request);

var_dump($response->getBody();

Auf dieser Seite