Zum Hauptinhalt springen

Get ai hosting plan and usages of a project

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

Request​

  • projectIdstringrequired

Responses​

Format
application/json
Beschreibung

The project usage and plan.

  • descriptionstring
  • keysobjectrequired
    • availableinteger (≥ -1)required
    • planLimitinteger (≥ -1)required
    • usedinteger (≥ 0)required
  • modelTermsApprovalRequiredbooleanrequired
  • nextTokenResetstring (date-time)
  • planIdstringrequired
  • projectIdstringrequired
  • suspendedboolean
Content-Type: application/json

{
"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": {
"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"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/projects/string/ai-hosting?planId=string
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.aiHostingProjectGetUsage({
"projectId": "string",
"queryParameters": {
"planId": "string"
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\AIHosting\AiHostingProjectGetUsage\AiHostingProjectGetUsageRequest;

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

$request = (new AiHostingProjectGetUsageRequest(
projectId: "string"
))
->withPlanId("string");
$response = $client->aiHosting()->aiHostingProjectGetUsage($request);

var_dump($response->getBody();

Auf dieser Seite