Zum Hauptinhalt springen

Get all ai hosting keys the authenticated user can access

GET/v2/ai-hosting-keys
API-Version
v2
Request-Methode
GET
Operation-ID
ai-hosting-user-get-keys

Lists every AI hosting key the user reaches through its organizations, including the keys assigned to one of their projects, with the organization, project and plan names denormalized. A membership in a project alone grants no access to its keys. A user without any AI hosting gets an empty list, not an error.

Request​

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 keys the user can access.

  • Array[

    One AI hosting key the authenticated user can reach, with the organization, project and plan names denormalized so the list needs no second call.

    • *object

      One AI hosting key the authenticated user can reach, with the organization, project and plan names denormalized so the list needs no second call.

      • containerMetaobject
        • containerIdstring
        • errorMessagestring
        • ingressIdstring
        • stackIdstring
        • statusstring (einer von: created, requested, failed)
          required
      • createdAtstring (date-time)
        required
      • customerIdstring
        required
      • customerNamestring
        required
      • isBlockedboolean
        required

        Indicates whether the key is blocked.

      • keystring
        deprecated
        required

        The secret API key. For security reasons we no longer want to keep exposing this value on every response — this field is deprecated and will stop returning the real key in a future change. It still returns the real value for now.

      • keyIdstring
        required

        Auto generated uuid to identify keys in requests.

      • modelsArray von string
        deprecated
        required

        This Field is deprecated. You can find the allowed models in the /ai-hosting route.

        • Array[
          • *string
          ]
      • namestring
        required
      • planDescriptionstring
        required
      • planIdstring
        required
      • projectIdstring
      • projectNamestring

        Empty when the key is not assigned to a project.

      • rateLimitobject
        required

        The number of allowed requests per unit. Limits are shared across all keys within the same project.

        • allowedRequestsPerUnitinteger
          required
        • unit"minute"
          required
      • tokenUsageobject
        required
        • planLimitinteger (≥ -1, int64)
          required
        • usedinteger (≥ 0, int64)
          required
    ]
Content-Type: application/json

[
{
"containerMeta": {
"containerId": "string",
"errorMessage": "string",
"ingressId": "string",
"stackId": "string",
"status": "created"
},
"createdAt": "1985-10-26T01:21:00.000Z",
"customerId": "string",
"customerName": "string",
"isBlocked": true,
"keyId": "string",
"name": "string",
"planDescription": "string",
"planId": "string",
"projectId": "string",
"projectName": "string",
"rateLimit": {
"allowedRequestsPerUnit": 123,
"unit": "minute"
},
"tokenUsage": {
"planLimit": 123,
"used": 123
}
}
]
{
"items": {
"description": "One AI hosting key the authenticated user can reach, with the organization,\nproject and plan names denormalized so the list needs no second call.\n",
"properties": {
"containerMeta": {
"properties": {
"containerId": {
"type": "string"
},
"errorMessage": {
"type": "string"
},
"ingressId": {
"type": "string"
},
"stackId": {
"type": "string"
},
"status": {
"enum": [
"created",
"requested",
"failed"
],
"type": "string"
}
},
"required": [
"status"
],
"type": "object"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"customerId": {
"type": "string"
},
"customerName": {
"type": "string"
},
"isBlocked": {
"default": false,
"description": "Indicates whether the key is blocked.",
"type": "boolean"
},
"key": {
"deprecated": true,
"description": "The secret API key. For security reasons we no longer want to keep exposing this value on every response — this field is deprecated and will stop returning the real key in a future change. It still returns the real value for now.",
"type": "string"
},
"keyId": {
"description": "Auto generated uuid to identify keys in requests.",
"type": "string"
},
"models": {
"deprecated": true,
"description": "This Field is deprecated. You can find the allowed models in the /ai-hosting route.",
"items": {
"type": "string"
},
"type": "array"
},
"name": {
"type": "string"
},
"planDescription": {
"type": "string"
},
"planId": {
"type": "string"
},
"projectId": {
"type": "string"
},
"projectName": {
"description": "Empty when the key is not assigned to a project.",
"type": "string"
},
"rateLimit": {
"description": "The number of allowed requests per unit. Limits are shared across all keys within the same project.",
"properties": {
"allowedRequestsPerUnit": {
"type": "integer"
},
"unit": {
"enum": [
"minute"
],
"type": "string"
}
},
"required": [
"allowedRequestsPerUnit",
"unit"
],
"type": "object"
},
"tokenUsage": {
"properties": {
"planLimit": {
"format": "int64",
"minimum": -1,
"type": "integer"
},
"used": {
"format": "int64",
"minimum": 0,
"type": "integer"
}
},
"required": [
"used",
"planLimit"
],
"type": "object"
}
},
"required": [
"keyId",
"customerId",
"customerName",
"planId",
"planDescription",
"key",
"models",
"name",
"isBlocked",
"tokenUsage",
"rateLimit",
"createdAt"
],
"type": "object"
},
"type": "array"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/ai-hosting-keys?customerId=string&projectId=string&planId=string&searchTerm=string&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.aiHostingUserGetKeys({
"queryParameters": {
"customerId": "string",
"projectId": "string",
"planId": "string",
"searchTerm": "string",
"limit": 50,
"page": 1
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\AIHosting\AiHostingUserGetKeys\AiHostingUserGetKeysRequest;

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

$request = (new AiHostingUserGetKeysRequest())
->withCustomerId("string")
->withProjectId("string")
->withPlanId("string")
->withSearchTerm("string")
->withLimit(50)
->withPage(1);
$response = $client->aiHosting()->aiHostingUserGetKeys($request);

var_dump($response->getBody();

Auf dieser Seite