Skip to content

Commit c91dccf

Browse files
feat: Allow API keys to create API and restricted keys (#8663)
1 parent f04a506 commit c91dccf

15 files changed

Lines changed: 851 additions & 4 deletions

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 110
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f0eb12cf4df4fa3046bd88aae4966062eb6e9703768a07a0136da2f26a2ebd56.yml
3-
openapi_spec_hash: cdbd63a8162f1e987e937042cbd60eea
4-
config_hash: 526cf0707adc54c690fc687a1c6db728
1+
configured_endpoints: 112
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f1ad4729124d46b6b2f926f177680a9644c6701d7e7c87731df9bf21a6414546.yml
3+
openapi_spec_hash: eb49220bba68581587f2d9d4d79d0c7e
4+
config_hash: 636a44fb2f5d76373805b629a0f3dd35

api.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,3 +439,31 @@ Methods:
439439
- <code title="post /v1/mcp-configs/{id}">client.mcp_configs.<a href="./src/runloop_api_client/resources/mcp_configs.py">update</a>(id, \*\*<a href="src/runloop_api_client/types/mcp_config_update_params.py">params</a>) -> <a href="./src/runloop_api_client/types/mcp_config_view.py">McpConfigView</a></code>
440440
- <code title="get /v1/mcp-configs">client.mcp_configs.<a href="./src/runloop_api_client/resources/mcp_configs.py">list</a>(\*\*<a href="src/runloop_api_client/types/mcp_config_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/mcp_config_view.py">SyncMcpConfigsCursorIDPage[McpConfigView]</a></code>
441441
- <code title="post /v1/mcp-configs/{id}/delete">client.mcp_configs.<a href="./src/runloop_api_client/resources/mcp_configs.py">delete</a>(id) -> <a href="./src/runloop_api_client/types/mcp_config_view.py">McpConfigView</a></code>
442+
443+
# Apikeys
444+
445+
Types:
446+
447+
```python
448+
from runloop_api_client.types import APIKeyCreatedView, APIKeyCreateParameters
449+
```
450+
451+
Methods:
452+
453+
- <code title="post /v1/apikeys">client.apikeys.<a href="./src/runloop_api_client/resources/apikeys.py">create</a>(\*\*<a href="src/runloop_api_client/types/apikey_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/api_key_created_view.py">APIKeyCreatedView</a></code>
454+
455+
# RestrictedKeys
456+
457+
Types:
458+
459+
```python
460+
from runloop_api_client.types import (
461+
RestrictedKeyCreatedView,
462+
RestrictedKeyCreateParameters,
463+
ScopeEntryView,
464+
)
465+
```
466+
467+
Methods:
468+
469+
- <code title="post /v1/restricted_keys">client.restricted_keys.<a href="./src/runloop_api_client/resources/restricted_keys.py">create</a>(\*\*<a href="src/runloop_api_client/types/restricted_key_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/restricted_key_created_view.py">RestrictedKeyCreatedView</a></code>

src/runloop_api_client/_client.py

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from .resources import (
3535
axons,
3636
agents,
37+
apikeys,
3738
objects,
3839
secrets,
3940
devboxes,
@@ -44,9 +45,11 @@
4445
benchmark_jobs,
4546
benchmark_runs,
4647
gateway_configs,
48+
restricted_keys,
4749
network_policies,
4850
)
4951
from .resources.agents import AgentsResource, AsyncAgentsResource
52+
from .resources.apikeys import ApikeysResource, AsyncApikeysResource
5053
from .resources.objects import ObjectsResource, AsyncObjectsResource
5154
from .resources.secrets import SecretsResource, AsyncSecretsResource
5255
from .resources.benchmarks import BenchmarksResource, AsyncBenchmarksResource
@@ -56,6 +59,7 @@
5659
from .resources.benchmark_jobs import BenchmarkJobsResource, AsyncBenchmarkJobsResource
5760
from .resources.benchmark_runs import BenchmarkRunsResource, AsyncBenchmarkRunsResource
5861
from .resources.gateway_configs import GatewayConfigsResource, AsyncGatewayConfigsResource
62+
from .resources.restricted_keys import RestrictedKeysResource, AsyncRestrictedKeysResource
5963
from .resources.network_policies import NetworkPoliciesResource, AsyncNetworkPoliciesResource
6064
from .resources.devboxes.devboxes import DevboxesResource, AsyncDevboxesResource
6165
from .resources.scenarios.scenarios import ScenariosResource, AsyncScenariosResource
@@ -198,6 +202,18 @@ def mcp_configs(self) -> McpConfigsResource:
198202

199203
return McpConfigsResource(self)
200204

205+
@cached_property
206+
def apikeys(self) -> ApikeysResource:
207+
from .resources.apikeys import ApikeysResource
208+
209+
return ApikeysResource(self)
210+
211+
@cached_property
212+
def restricted_keys(self) -> RestrictedKeysResource:
213+
from .resources.restricted_keys import RestrictedKeysResource
214+
215+
return RestrictedKeysResource(self)
216+
201217
@cached_property
202218
def with_raw_response(self) -> RunloopWithRawResponse:
203219
return RunloopWithRawResponse(self)
@@ -446,6 +462,18 @@ def mcp_configs(self) -> AsyncMcpConfigsResource:
446462

447463
return AsyncMcpConfigsResource(self)
448464

465+
@cached_property
466+
def apikeys(self) -> AsyncApikeysResource:
467+
from .resources.apikeys import AsyncApikeysResource
468+
469+
return AsyncApikeysResource(self)
470+
471+
@cached_property
472+
def restricted_keys(self) -> AsyncRestrictedKeysResource:
473+
from .resources.restricted_keys import AsyncRestrictedKeysResource
474+
475+
return AsyncRestrictedKeysResource(self)
476+
449477
@cached_property
450478
def with_raw_response(self) -> AsyncRunloopWithRawResponse:
451479
return AsyncRunloopWithRawResponse(self)
@@ -643,6 +671,18 @@ def mcp_configs(self) -> mcp_configs.McpConfigsResourceWithRawResponse:
643671

644672
return McpConfigsResourceWithRawResponse(self._client.mcp_configs)
645673

674+
@cached_property
675+
def apikeys(self) -> apikeys.ApikeysResourceWithRawResponse:
676+
from .resources.apikeys import ApikeysResourceWithRawResponse
677+
678+
return ApikeysResourceWithRawResponse(self._client.apikeys)
679+
680+
@cached_property
681+
def restricted_keys(self) -> restricted_keys.RestrictedKeysResourceWithRawResponse:
682+
from .resources.restricted_keys import RestrictedKeysResourceWithRawResponse
683+
684+
return RestrictedKeysResourceWithRawResponse(self._client.restricted_keys)
685+
646686

647687
class AsyncRunloopWithRawResponse:
648688
_client: AsyncRunloop
@@ -728,6 +768,18 @@ def mcp_configs(self) -> mcp_configs.AsyncMcpConfigsResourceWithRawResponse:
728768

729769
return AsyncMcpConfigsResourceWithRawResponse(self._client.mcp_configs)
730770

771+
@cached_property
772+
def apikeys(self) -> apikeys.AsyncApikeysResourceWithRawResponse:
773+
from .resources.apikeys import AsyncApikeysResourceWithRawResponse
774+
775+
return AsyncApikeysResourceWithRawResponse(self._client.apikeys)
776+
777+
@cached_property
778+
def restricted_keys(self) -> restricted_keys.AsyncRestrictedKeysResourceWithRawResponse:
779+
from .resources.restricted_keys import AsyncRestrictedKeysResourceWithRawResponse
780+
781+
return AsyncRestrictedKeysResourceWithRawResponse(self._client.restricted_keys)
782+
731783

732784
class RunloopWithStreamedResponse:
733785
_client: Runloop
@@ -813,6 +865,18 @@ def mcp_configs(self) -> mcp_configs.McpConfigsResourceWithStreamingResponse:
813865

814866
return McpConfigsResourceWithStreamingResponse(self._client.mcp_configs)
815867

868+
@cached_property
869+
def apikeys(self) -> apikeys.ApikeysResourceWithStreamingResponse:
870+
from .resources.apikeys import ApikeysResourceWithStreamingResponse
871+
872+
return ApikeysResourceWithStreamingResponse(self._client.apikeys)
873+
874+
@cached_property
875+
def restricted_keys(self) -> restricted_keys.RestrictedKeysResourceWithStreamingResponse:
876+
from .resources.restricted_keys import RestrictedKeysResourceWithStreamingResponse
877+
878+
return RestrictedKeysResourceWithStreamingResponse(self._client.restricted_keys)
879+
816880

817881
class AsyncRunloopWithStreamedResponse:
818882
_client: AsyncRunloop
@@ -898,6 +962,18 @@ def mcp_configs(self) -> mcp_configs.AsyncMcpConfigsResourceWithStreamingRespons
898962

899963
return AsyncMcpConfigsResourceWithStreamingResponse(self._client.mcp_configs)
900964

965+
@cached_property
966+
def apikeys(self) -> apikeys.AsyncApikeysResourceWithStreamingResponse:
967+
from .resources.apikeys import AsyncApikeysResourceWithStreamingResponse
968+
969+
return AsyncApikeysResourceWithStreamingResponse(self._client.apikeys)
970+
971+
@cached_property
972+
def restricted_keys(self) -> restricted_keys.AsyncRestrictedKeysResourceWithStreamingResponse:
973+
from .resources.restricted_keys import AsyncRestrictedKeysResourceWithStreamingResponse
974+
975+
return AsyncRestrictedKeysResourceWithStreamingResponse(self._client.restricted_keys)
976+
901977

902978
Client = Runloop
903979

src/runloop_api_client/resources/__init__.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
AgentsResourceWithStreamingResponse,
1717
AsyncAgentsResourceWithStreamingResponse,
1818
)
19+
from .apikeys import (
20+
ApikeysResource,
21+
AsyncApikeysResource,
22+
ApikeysResourceWithRawResponse,
23+
AsyncApikeysResourceWithRawResponse,
24+
ApikeysResourceWithStreamingResponse,
25+
AsyncApikeysResourceWithStreamingResponse,
26+
)
1927
from .objects import (
2028
ObjectsResource,
2129
AsyncObjectsResource,
@@ -96,6 +104,14 @@
96104
GatewayConfigsResourceWithStreamingResponse,
97105
AsyncGatewayConfigsResourceWithStreamingResponse,
98106
)
107+
from .restricted_keys import (
108+
RestrictedKeysResource,
109+
AsyncRestrictedKeysResource,
110+
RestrictedKeysResourceWithRawResponse,
111+
AsyncRestrictedKeysResourceWithRawResponse,
112+
RestrictedKeysResourceWithStreamingResponse,
113+
AsyncRestrictedKeysResourceWithStreamingResponse,
114+
)
99115
from .network_policies import (
100116
NetworkPoliciesResource,
101117
AsyncNetworkPoliciesResource,
@@ -184,4 +200,16 @@
184200
"AsyncMcpConfigsResourceWithRawResponse",
185201
"McpConfigsResourceWithStreamingResponse",
186202
"AsyncMcpConfigsResourceWithStreamingResponse",
203+
"ApikeysResource",
204+
"AsyncApikeysResource",
205+
"ApikeysResourceWithRawResponse",
206+
"AsyncApikeysResourceWithRawResponse",
207+
"ApikeysResourceWithStreamingResponse",
208+
"AsyncApikeysResourceWithStreamingResponse",
209+
"RestrictedKeysResource",
210+
"AsyncRestrictedKeysResource",
211+
"RestrictedKeysResourceWithRawResponse",
212+
"AsyncRestrictedKeysResourceWithRawResponse",
213+
"RestrictedKeysResourceWithStreamingResponse",
214+
"AsyncRestrictedKeysResourceWithStreamingResponse",
187215
]

0 commit comments

Comments
 (0)