Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

updated openapi spec

Swiftya1d9b4523805
diff --git a/autogpt_platform/backend/backend/data/model.py b/autogpt_platform/backend/backend/data/model.py
index 846b076546..1a34cde65d 100644
--- a/autogpt_platform/backend/backend/data/model.py
+++ b/autogpt_platform/backend/backend/data/model.py
@@ -344,9 +344,10 @@ class APIKeyCredentials(_BaseCredentials):
default=None,
description="Unix timestamp (seconds) indicating when the API key expires (if at all)",
)
- api_key_env_var: Optional[str] = None
"""Unix timestamp (seconds) indicating when the API key expires (if at all)"""
+ api_key_env_var: Optional[str] = Field(default=None, exclude=True)
+
def auth_header(self) -> str:
return f"Bearer {self.api_key.get_secret_value()}"
diff --git a/autogpt_platform/frontend/src/app/api/openapi.json b/autogpt_platform/frontend/src/app/api/openapi.json
index 39494b1b1f..f36a48cfd6 100644
--- a/autogpt_platform/frontend/src/app/api/openapi.json
+++ b/autogpt_platform/frontend/src/app/api/openapi.json
@@ -207,7 +207,7 @@
"schema": {
"oneOf": [
{ "$ref": "#/components/schemas/OAuth2Credentials" },
- { "$ref": "#/components/schemas/APIKeyCredentials" },
+ { "$ref": "#/components/schemas/APIKeyCredentials-Input" },
{ "$ref": "#/components/schemas/UserPasswordCredentials" },
{ "$ref": "#/components/schemas/HostScopedCredentials-Input" }
],
@@ -215,7 +215,7 @@
"propertyName": "type",
"mapping": {
"oauth2": "#/components/schemas/OAuth2Credentials",
- "api_key": "#/components/schemas/APIKeyCredentials",
+ "api_key": "#/components/schemas/APIKeyCredentials-Input",
"user_password": "#/components/schemas/UserPasswordCredentials",
"host_scoped": "#/components/schemas/HostScopedCredentials-Input"
}
@@ -233,7 +233,7 @@
"schema": {
"oneOf": [
{ "$ref": "#/components/schemas/OAuth2Credentials" },
- { "$ref": "#/components/schemas/APIKeyCredentials" },
+ { "$ref": "#/components/schemas/APIKeyCredentials-Output" },
{ "$ref": "#/components/schemas/UserPasswordCredentials" },
{
"$ref": "#/components/schemas/HostScopedCredentials-Output"
@@ -243,7 +243,7 @@
"propertyName": "type",
"mapping": {
"oauth2": "#/components/schemas/OAuth2Credentials",
- "api_key": "#/components/schemas/APIKeyCredentials",
+ "api_key": "#/components/schemas/APIKeyCredentials-Output",
"user_password": "#/components/schemas/UserPasswordCredentials",
"host_scoped": "#/components/schemas/HostScopedCredentials-Output"
}
@@ -302,7 +302,7 @@
"schema": {
"oneOf": [
{ "$ref": "#/components/schemas/OAuth2Credentials" },
- { "$ref": "#/components/schemas/APIKeyCredentials" },
+ { "$ref": "#/components/schemas/APIKeyCredentials-Output" },
{ "$ref": "#/components/schemas/UserPasswordCredentials" },
{
"$ref": "#/components/schemas/HostScopedCredentials-Output"
@@ -312,7 +312,7 @@
"propertyName": "type",
"mapping": {
"oauth2": "#/components/schemas/OAuth2Credentials",
- "api_key": "#/components/schemas/APIKeyCredentials",
+ "api_key": "#/components/schemas/APIKeyCredentials-Output",
"user_password": "#/components/schemas/UserPasswordCredentials",
"host_scoped": "#/components/schemas/HostScopedCredentials-Output"
}
@@ -4782,7 +4782,41 @@
},
"components": {
"schemas": {
- "APIKeyCredentials": {
+ "APIKeyCredentials-Input": {
+ "properties": {
+ "id": { "type": "string", "title": "Id" },
+ "provider": { "type": "string", "title": "Provider" },
+ "title": {
+ "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "title": "Title"
+ },
+ "type": {
+ "type": "string",
+ "const": "api_key",
+ "title": "Type",
+ "default": "api_key"
+ },
+ "api_key": {
+ "type": "string",
+ "format": "password",
+ "title": "Api Key",
+ "writeOnly": true
+ },
+ "expires_at": {
+ "anyOf": [{ "type": "integer" }, { "type": "null" }],
+ "title": "Expires At",
+ "description": "Unix timestamp (seconds) indicating when the API key expires (if at all)"
+ },
+ "api_key_env_var": {
+ "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "title": "Api Key Env Var"
+ }
+ },
+ "type": "object",
+ "required": ["provider", "api_key"],
+ "title": "APIKeyCredentials"
+ },
+ "APIKeyCredentials-Output": {
"properties": {
"id": { "type": "string", "title": "Id" },
"provider": { "type": "string", "title": "Provider" },