To solve the optimization problem described, we first need to define the decision variables and the objective function. Let's denote:

- $x_A$ as the amount of cream Alpha (in mg) to be used in the mixture.
- $x_B$ as the amount of cream Beta (in mg) to be used in the mixture.

The objective is to minimize the total cost of the mixture, given that it costs $0.70 per mg for cream Alpha and $0.90 per mg for cream Beta. Thus, the objective function can be written as:

\[ \text{Minimize} \quad 0.70x_A + 0.90x_B \]

The constraints are based on the requirements for the amounts of compound X and Y in the final mixture:

1. The mixture must contain at least 4 units of compound X.
2. The mixture must contain at least 8 units of compound Y.

Given that cream Alpha contains 2 units/mg of compound X and 2.7 units/mg of compound Y, and cream Beta contains 4.1 units/mg of compound X and 3.2 units/mg of compound Y, we can formulate the constraints as follows:

\[ 2x_A + 4.1x_B \geq 4 \] (Compound X constraint)
\[ 2.7x_A + 3.2x_B \geq 8 \] (Compound Y constraint)

Additionally, since we cannot have a negative amount of cream in the mixture, we have non-negativity constraints:

\[ x_A \geq 0 \]
\[ x_B \geq 0 \]

Now, let's translate this formulation into Gurobi code in Python:

```python
from gurobipy import *

# Create a new model
m = Model("Kappa_Medical")

# Define the decision variables
x_A = m.addVar(name='x_A', lb=0)  # Amount of cream Alpha
x_B = m.addVar(name='x_B', lb=0)  # Amount of cream Beta

# Set the objective function: minimize the total cost
m.setObjective(0.70*x_A + 0.90*x_B, GRB.MINIMIZE)

# Add constraints for compound X and Y requirements
m.addConstr(2*x_A + 4.1*x_B >= 4, name='compound_X')
m.addConstr(2.7*x_A + 3.2*x_B >= 8, name='compound_Y')

# Optimize the model
m.optimize()

# Print out the results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Amount of cream Alpha: {x_A.x} mg")
    print(f"Amount of cream Beta: {x_B.x} mg")
    print(f"Total cost: ${m.objVal:.2f}")
else:
    print("No optimal solution found. The model is either infeasible or unbounded.")
```