@@ -44,6 +44,10 @@ API keys can be obtained and managed at [https://swarms.world/platform/api-keys]
44
44
| ` /v1/swarm/schedule ` | GET | Get all scheduled swarm jobs |
45
45
| ` /v1/swarm/schedule/{job_id} ` | DELETE | Cancel a scheduled swarm job |
46
46
| ` /v1/swarm/logs ` | GET | Retrieve API request logs |
47
+ | ` /v1/swarms/available ` | GET | Get all available swarms as a list of strings |
48
+ | ` /v1/models/available ` | GET | Get all available models as a list of strings |
49
+
50
+
47
51
48
52
### SwarmType Reference
49
53
@@ -63,6 +67,57 @@ The `swarm_type` parameter defines the architecture and collaboration pattern of
63
67
| ` MajorityVoting ` | Uses a consensus mechanism where multiple agents vote on the best solution |
64
68
| ` auto ` | Automatically selects the most appropriate swarm type for the given task |
65
69
70
+
71
+
72
+ ## Data Models
73
+
74
+ ### SwarmSpec
75
+
76
+ The ` SwarmSpec ` model defines the configuration of a swarm.
77
+
78
+ | Field | Type | Description | Required |
79
+ | -------| ------| -------------| ----------|
80
+ | name | string | Identifier for the swarm | No |
81
+ | description | string | Description of the swarm's purpose | No |
82
+ | agents | Array<AgentSpec > | List of agent specifications | No |
83
+ | max_loops | integer | Maximum number of execution loops | No |
84
+ | swarm_type | SwarmType | Architecture of the swarm | No |
85
+ | rearrange_flow | string | Instructions for rearranging task flow | No |
86
+ | task | string | The main task for the swarm to accomplish | Yes |
87
+ | img | string | Optional image URL for the swarm | No |
88
+ | return_history | boolean | Whether to return execution history | No |
89
+ | rules | string | Guidelines for swarm behavior | No |
90
+ | schedule | ScheduleSpec | Scheduling information | No |
91
+
92
+ ### AgentSpec
93
+
94
+ The ` AgentSpec ` model defines the configuration of an individual agent.
95
+
96
+ | Field | Type | Description | Required |
97
+ | -------| ------| -------------| ----------|
98
+ | agent_name | string | Unique name for the agent | Yes* |
99
+ | description | string | Description of the agent's purpose | No |
100
+ | system_prompt | string | Instructions for the agent | No |
101
+ | model_name | string | AI model to use (e.g., "gpt-4o") | Yes* |
102
+ | auto_generate_prompt | boolean | Whether to auto-generate prompts | No |
103
+ | max_tokens | integer | Maximum tokens in response | No |
104
+ | temperature | float | Randomness of responses (0-1) | No |
105
+ | role | string | Agent's role in the swarm | No |
106
+ | max_loops | integer | Maximum iterations for this agent | No |
107
+
108
+ * Required if agents are manually specified; not required if using auto-generated agents
109
+
110
+ ### ScheduleSpec
111
+
112
+ The ` ScheduleSpec ` model defines when a swarm should be executed.
113
+
114
+ | Field | Type | Description | Required |
115
+ | -------| ------| -------------| ----------|
116
+ | scheduled_time | datetime | Time when the swarm should run | Yes |
117
+ | timezone | string | Timezone for the scheduled time | No (defaults to "UTC") |
118
+
119
+
120
+
66
121
### Endpoint Details
67
122
68
123
#### Health Check
@@ -397,6 +452,50 @@ curl -X DELETE "https://api.swarms.world/v1/swarm/schedule/swarm_daily-market-an
397
452
}
398
453
` ` `
399
454
455
+
456
+ # ## Get Models
457
+
458
+ # ### Get Available Models
459
+
460
+ Get all available models as a list of strings.
461
+
462
+ ** Endpoint** : ` /v1/models/available`
463
+ ** Method** : GET
464
+
465
+ ** Example Request** :
466
+ ` ` ` bash
467
+ curl -X GET " https://api.swarms.world/v1/models/available" \
468
+ -H " x-api-key: your_api_key_here"
469
+ ` ` `
470
+
471
+
472
+ ------
473
+
474
+
475
+ # ## Get Swarms Available
476
+
477
+ Get all available swarms as a list of strings.
478
+
479
+ ** Endpoint** : ` /v1/swarms/available`
480
+ ** Method** : GET
481
+
482
+ ** Example Request** :
483
+ ` ` ` bash
484
+ curl -X GET " https://api.swarms.world/v1/swarms/available" \
485
+ -H " x-api-key: your_api_key_here"
486
+ ` ` `
487
+
488
+ ** Example Response** :
489
+ ` ` ` json
490
+ {
491
+ " status" : " success" ,
492
+ " swarms" : [" financial-analysis-swarm" , " market-sentiment-swarm" ]
493
+ }
494
+ ` ` `
495
+
496
+ -------
497
+
498
+
400
499
# ### Get API Logs
401
500
402
501
Retrieve logs of API requests made with your API key.
@@ -432,53 +531,6 @@ curl -X GET "https://api.swarms.world/v1/swarm/logs" \
432
531
}
433
532
` ` `
434
533
435
- # # Data Models
436
-
437
- # ## SwarmSpec
438
-
439
- The ` SwarmSpec` model defines the configuration of a swarm.
440
-
441
- | Field | Type | Description | Required |
442
- | -------| ------| -------------| ----------|
443
- | name | string | Identifier for the swarm | No |
444
- | description | string | Description of the swarm' s purpose | No |
445
- | agents | Array<AgentSpec> | List of agent specifications | No |
446
- | max_loops | integer | Maximum number of execution loops | No |
447
- | swarm_type | SwarmType | Architecture of the swarm | No |
448
- | rearrange_flow | string | Instructions for rearranging task flow | No |
449
- | task | string | The main task for the swarm to accomplish | Yes |
450
- | img | string | Optional image URL for the swarm | No |
451
- | return_history | boolean | Whether to return execution history | No |
452
- | rules | string | Guidelines for swarm behavior | No |
453
- | schedule | ScheduleSpec | Scheduling information | No |
454
-
455
- ### AgentSpec
456
-
457
- The `AgentSpec` model defines the configuration of an individual agent.
458
-
459
- | Field | Type | Description | Required |
460
- |-------|------|-------------|----------|
461
- | agent_name | string | Unique name for the agent | Yes* |
462
- | description | string | Description of the agent' s purpose | No |
463
- | system_prompt | string | Instructions for the agent | No |
464
- | model_name | string | AI model to use (e.g., " gpt-4o" ) | Yes* |
465
- | auto_generate_prompt | boolean | Whether to auto-generate prompts | No |
466
- | max_tokens | integer | Maximum tokens in response | No |
467
- | temperature | float | Randomness of responses (0-1) | No |
468
- | role | string | Agent' s role in the swarm | No |
469
- | max_loops | integer | Maximum iterations for this agent | No |
470
-
471
- *Required if agents are manually specified; not required if using auto-generated agents
472
-
473
- ### ScheduleSpec
474
-
475
- The `ScheduleSpec` model defines when a swarm should be executed.
476
-
477
- | Field | Type | Description | Required |
478
- |-------|------|-------------|----------|
479
- | scheduled_time | datetime | Time when the swarm should run | Yes |
480
- | timezone | string | Timezone for the scheduled time | No (defaults to "UTC") |
481
-
482
534
# # Production Examples
483
535
484
536
# ## Python Examples
0 commit comments