@@ -18,20 +18,20 @@ Nebula provides a conversational interface to interact with blockchain data and
1818
1919All API requests should be made to:
2020
21- ```
21+ ``` bash
2222https://nebula-api.thirdweb.com
2323```
2424
2525## Authentication
2626
2727All API endpoints require authentication using the thirdweb secret key. Include this key in your request headers:
2828
29- ``` http
29+ ``` bash
3030x-secret-key: YOUR_THIRDWEB_SECRET_KEY
3131```
3232
3333Example curl with authentication:
34- ```
34+ ``` bash
3535curl -X POST https://nebula-api.thirdweb.com/chat \
3636 -H " Content-Type: application/json" \
3737 -H " x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \
@@ -130,7 +130,7 @@ When `stream: true`, the API uses Server-Sent Events (SSE) to stream the respons
1301305 . ` error ` : Contains error information if something goes wrong
131131
132132** Example SSE Stream:**
133- ```
133+ ``` tsx
134134event : init
135135data : {
136136 " session_id" : " f4b45429-9570-4ee8-8c8f-8b267429915a" ,
@@ -407,14 +407,14 @@ const result = await handleNebulaResponse(data);
407407
408408#### Execute Command
409409
410- ```
410+ ``` bash
411411POST /execute
412412```
413413
414414Execute specific blockchain commands or actions.
415415
416416** Request Body:**
417- ```
417+ ``` bash
418418{
419419 " message" : " Deploy a new ERC20 contract" ,
420420 " session_id" : " sess_01HKW2ZH45JNQRTM0YPKJ6QXXX" , // Optional
@@ -427,7 +427,7 @@ Execute specific blockchain commands or actions.
427427```
428428
429429** Example curl:**
430- ```
430+ ``` bash
431431curl -X POST https://nebula-api.thirdweb.com/execute \
432432 -H " Content-Type: application/json" \
433433 -H " x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \
@@ -440,25 +440,25 @@ curl -X POST https://nebula-api.thirdweb.com/execute \
440440 }
441441 }'
442442```
443- -->
443+
444444### Sessions
445445
446446#### List Sessions
447447
448- ```
448+ ``` bash
449449GET /session/list
450450```
451451
452452Retrieve available sessions for the authenticated account.
453453
454454** Example curl:**
455- ```
455+ ``` bash
456456curl -X GET https://nebula-api.thirdweb.com/session/list \
457457 -H " x-secret-key: YOUR_THIRDWEB_SECRET_KEY"
458458```
459459
460460** Response:**
461- ```
461+ ``` bash
462462{
463463 " result" : [
464464 {
@@ -475,20 +475,20 @@ curl -X GET https://nebula-api.thirdweb.com/session/list \
475475
476476#### Get Session
477477
478- ```
478+ ``` bash
479479GET /session/{session_id}
480480```
481481
482482Get details for a specific session.
483483
484484** Example curl:**
485- ```
485+ ``` bash
486486curl -X GET https://nebula-api.thirdweb.com/session/abc123 \
487487 -H " x-secret-key: YOUR_THIRDWEB_SECRET_KEY"
488488```
489489
490490** Response:**
491- ```
491+ ``` tsx
492492{
493493 " result" : {
494494 " id" : " string" ,
@@ -504,14 +504,14 @@ curl -X GET https://nebula-api.thirdweb.com/session/abc123 \
504504
505505#### Create Session
506506
507- ```
507+ ``` bash
508508POST /session
509509```
510510
511511Create a new chat session.
512512
513513** Request Body:**
514- ```
514+ ``` tsx
515515{
516516 " title" : " My DeFi Research" , // Optional: Custom session title
517517 " is_public" : true , // Optional: Make session publicly accessible
@@ -523,7 +523,7 @@ Create a new chat session.
523523```
524524
525525** Example curl:**
526- ```
526+ ``` bash
527527curl -X POST https://nebula-api.thirdweb.com/session \
528528 -H " Content-Type: application/json" \
529529 -H " x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \
@@ -538,14 +538,14 @@ curl -X POST https://nebula-api.thirdweb.com/session \
538538
539539#### Update Session
540540
541- ```
541+ ``` bash
542542PUT /session/{session_id}
543543```
544544
545545Update an existing session.
546546
547547** Example curl:**
548- ```
548+ ``` bash
549549curl -X PUT https://nebula-api.thirdweb.com/session/abc123 \
550550 -H " Content-Type: application/json" \
551551 -H " x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \
@@ -556,7 +556,7 @@ curl -X PUT https://nebula-api.thirdweb.com/session/abc123 \
556556```
557557
558558** Request Body:**
559- ```
559+ ``` tsx
560560{
561561 " title" : " string" ,
562562 " is_public" : boolean
@@ -565,28 +565,28 @@ curl -X PUT https://nebula-api.thirdweb.com/session/abc123 \
565565
566566#### Clear Session
567567
568- ```
568+ ``` bash
569569POST /session/{session_id}/clear
570570```
571571
572572Clear a session's message history.
573573
574574** Example curl:**
575- ```
575+ ``` bash
576576curl -X POST https://nebula-api.thirdweb.com/session/abc123/clear \
577577 -H " x-secret-key: YOUR_THIRDWEB_SECRET_KEY"
578578```
579579
580580#### Delete Session
581581
582- ```
582+ ``` bash
583583DELETE /session/{session_id}
584584```
585585
586586Delete a session.
587587
588588** Example curl:**
589- ```
589+ ``` bash
590590curl -X DELETE https://nebula-api.thirdweb.com/session/abc123 \
591591 -H " x-secret-key: YOUR_THIRDWEB_SECRET_KEY"
592592```
@@ -595,7 +595,7 @@ curl -X DELETE https://nebula-api.thirdweb.com/session/abc123 \
595595
596596The API uses standard HTTP status codes and returns errors in this format:
597597
598- ```
598+ ``` bash
599599{
600600 " error" : {
601601 " message" : " Error description"
0 commit comments